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

Geoffrey esoteric at 3times25.net
Thu May 6 20:19:45 EDT 2004


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.

tar -cvf - $(find . -name '*.jpg' -print) |
	(cd /mnt/mymachine; tar -xvf - )

-- 
Until later, Geoffrey                     Registered Linux User #108567
Building secure systems in spite of Microsoft



More information about the Ale mailing list