Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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.

  2. #2
    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.

  3. #3
    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.

  4. $spacer_open
    $spacer_close
  5. #4
    OK, that makes it simple. You do it with the 'find' command as follows (I assuming /tmp was the temporary directory):

    Code:
    find /tmp -type f -maxdepth 1 -name "*.mp3" -exec mv {} /var/www/music/ \;
    You can ' man find' to find out what each option does.

  6. #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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •