Skip to content
Advertisement

How to copy a file to all subdirectories?

How can I paste read-me.jpg file into all sub-directories? Here is a command to create a new file in all subdirectories.

JavaScript

But I want to copy jpg file into all subdirectories instead.

Directory List:

JavaScript

already tried with this command but no output

JavaScript

Advertisement

Answer

You tried to redirect cp‘s output into $dir but instead we should specify the destination $dir/read-me.jpg as the second argument of cp

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement