Thursday, July 10, 2008

copy different folder in to single folder

If you want to copy to all subdirectories (ie Child_Directory1,2,3,4 etc are the only subdirs), you can do the following:
Code:
find <parent directory> -type d -exec cp <parent directory>/<Filename1> {}/ \;
If you have other junk in the parent dir but a pattern that matches all subdirs (eg Child_Directory*), you can do this (bourne/ksh/bash):
Code:
for subdir in <parent directory>/<pattern> ; do cp <parent directory>/<Filename1> ${subdir}/ ; done

No comments:

Post a Comment