[ale] Shell Scripting -> find files *.<ext> and move them to /backup

Robert Heaven robertheaven at earthlink.net
Thu May 6 17:48:41 EDT 2004


I think might work:

find / -name "*.jpg" -exec mv /mnt/mymachine/ {} \;


On Thu, 2004-05-06 at 17:06, Nathan J. Underwood wrote:

> Ok, this should be an easy one, but I can't seem to remember how to do 
> it.  I have a seriously dorked up Win98 workstation (won't boot) that a 
> friend has given me to 'turn into linux'.  Catch is, though, he wants to 
> keep all of his pictures (*.jpg, *.gif), movies (*.mpg), and documents 
> (*.doc, *.xls).  I've done it before (thanks to the help of someone 
> here, if I'm not terribly mistaken), and am currently perusing through 
> the archives trying to find it, but need a script that'll do something 
> like the following:
> 
> find all of the .jpg files, and move them to /mnt/mymachine (samba mount)
> find all of the .gif files, and move them to /mnt/mymachine (samba mount)
> etc.
> 
> The box is currently booted with knoppix, and I've mounted a directory 
> on my box to copy the files to.  Now, I've just gotta find a relatively 
> painless way to move 9,000+ files.
> 
> As a testament to how bad I am at shell scripting, I'm going to put what 
> I have so far (tab #2 in my browser is at linuxdoc.org trying to get all 
> the parameters right for find, exec, and copy).  As always, any help 
> would be greatly appreciated.
> 
> find *.jpg -exec copy $1 /backup
> 
> 
> ______________________________________________________________________
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
-------------- next part --------------
An HTML attachment was scrubbed...




More information about the Ale mailing list