How to copy a file to all subdirectories in a directory using a command-line?
26 06 18 • 13:32& Filed in: Coding
This will put the file "code.f" (in the current working directory) in all of the subfolders, but not their subfolders:
But this will put the file "code.f" in all of the subfolders and their subfolders:
for d in */; do cp code.f "$d"; done
But this will put the file "code.f" in all of the subfolders and their subfolders:
find . -type d -exec cp code.f {} \;