Re: Moving files help

From: Justin Dieters <enderak@mtaonline.net>
Date: Mon Feb 21 2005 - 15:08:20 AKST

Well, for a simple find and move like this, you can just use the
built-in exec option with the 'find' command.

Something like:
find /home/scott/wget/host.domain.tld -type f -exec mv {}
/some/other/directory \;

Note that if you move files to a directory somewhere within
/home/scott/wget/host.domain.tld, you will probably get a bunch of
errors saying file1.rar and file1.rar are the same file because it might
find the file again after you move it, but you can safely ignore them if
this is the case. To avoid these errors, simply move to some directory
above /home/scott/wget/host.domain.tld, as shown above.

Hope this helps.

Justin

Scott Johnson wrote:

>I have a bunch of files in different directories...
>
>/home/scott/wget/host.domain.tld/0/0/1/file1.rar
>/home/scott/wget/host.domain.tld/1/0/1/file2.rar
>/home/scott/wget/host.domain.tld/C/9/1/file3.rar
>/home/scott/wget/host.domain.tld/D/A/1/file4.rar
>/home/scott/wget/host.domain.tld/2/B/1/file5.rar
>/home/scott/wget/host.domain.tld/A/A/1/file6.rar
>/home/scott/wget/host.domain.tld/F/3/1/file7.rar
>/home/scott/wget/host.domain.tld/5/E/1/file8.rar
>
>with no pattern to the directory structure after the host.domain.tld
>directory. What I need to do is move all files from these various
>directories into a single directory.
>
>How can I move these files (recursively)?
>
>Thanks.
>
>
>

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Mon Feb 21 23:16:36 2005

This archive was generated by hypermail 2.1.8 : Mon Feb 21 2005 - 23:16:36 AKST