[WBEL-users] Linux Shell Scripting

Andrew Vong andrewvong at finpress.com
Sat Apr 30 13:41:15 CDT 2005


Dear Linux Gurus,

I'm trying to look and traverse a specific directory (e.g. /home/andrew) in 
search of certain files with a certain extension (e.g. .doc files) and then 
copy it to a backup location (e.g. /backup).

Thus far, I've been using this command line fine as long as there are no 
white spaces in the filenames.

Here is what I use:-

$ find /home/andrew/ | grep '\.doc' | xargs mv --target-directory=/backup/

This works for all files with no white spaces.

As the shared directory is shared via Samba to Windows users, there are 
directories and files with spaces in them.

I would really appreciate it if one of you gurus can help me out on this.

Thanks in advance.

Best Regards,
Andrew





More information about the Whitebox-users mailing list