[ale] Shell Scripting -> find files *.<ext> and move them to /backup
Nathan J. Underwood
ale1 at cybertechcafe.net
Thu May 6 17:08:01 EDT 2004
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
More information about the Ale
mailing list