Mohammadreza Hadizadeh

How to copy a file to all subdirectories in a directory using a command-line?

This will put the file "code.f" (in the current working directory) in all of the subfolders, but not 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 {} \;