move files to a series of subdirectories
how do I move one file to a series of subdirectories all of different names.
If they were numbered etc i would of used a for loop I would just like to know if there is anyway to move one file to every subdirectory. e.g. move file ghi to all the directories in in the current directory. |
How about this:
find -type d -maxdepth 1 -print0 | xargs -0 -n1 cp ghi Change the -maxdepth value to copy ghi to directories deeper than just the ones directly under the current directory. Leave the -maxdepth option off altogether to copy ghi into every directory under the current directory no matter how deep they get. You'll get a message about trying to overwrite ghi with itself in the current directory, but that shouldn't be a problem. Lyle |
All times are GMT -5. The time now is 12:15 AM. |