Tuesday, April 28, 2009

Copy one file to a bunch of directories using find and cp

find directory1 directory2 directory3 -type d -exec cp filename {} \;


what this command does:


First, I use the find command, and I tell it to


   1.  look in four sub-directories       (directory1, directory2, directory3 and directory4).


   2.  I tell it to find only directories (-type d).

No comments:

sanjay's shared items

My Blog List