Results 1 to 5 of 5
I am running a home serving using ubuntu server 8.04. I recently increased the size of my music folder. It now holds about 4,000 mp3's. When I tried to move ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-17-2008 #1Just Joined!
- Join Date
- May 2007
- Posts
- 5
trouble moving large directory
I am running a home serving using ubuntu server 8.04. I recently increased the size of my music folder. It now holds about 4,000 mp3's. When I tried to move them to my server from my main computer I get a "argument too long " error. I am assuming this is because the folder is so large now. I am using ssh to do this. Can anyone tell me how to accomplish this?
thanks.
- 11-17-2008 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
Yes it is because of the large no. of files. You have to show us the command you're using before we can help you. Hint: It'll involve using the 'find' command.
- 11-17-2008 #3Just Joined!
- Join Date
- May 2007
- Posts
- 5
Thanks for the quick response. I didn't explain it correctly. I uploaded the files without any problem to a tmp directory in the server home folder. The problem was in moving them from there to the /var/www/music folder. I figured out a way to do it that works. mv a*.mp3, it'll just take me twenty-seven commands to do it.
If you have a better way, please let me know.
thanks, again.
- 11-17-2008 #4Linux User
- Join Date
- Jun 2007
- Posts
- 318
OK, that makes it simple. You do it with the 'find' command as follows (I assuming /tmp was the temporary directory):
You can ' man find' to find out what each option does.Code:find /tmp -type f -maxdepth 1 -name "*.mp3" -exec mv {} /var/www/music/ \;
- 11-18-2008 #5Just Joined!
- Join Date
- May 2007
- Posts
- 5
reply
Thanks again. I had already moved them my long simple way. This will be a lesson I won't soon forget. But I guess that's the best way to learn the cli, by making mistakes and asking the questions.
Have a good day and thanks again.
Bob


Reply With Quote
