I don't really understand bash scripts. It is necessary to implement probably a simple task. The file is located at A. It needs to be excavated in ALL subdirectories of the directory with address B. I will be grateful for examples and hints

2 answers 2

or

find b_directory -type d -exec cp -v path/file.txt {} \;

    If I understand the task correctly, then you can use this spell (the first thing that came to mind)

     find b_directory -type d | xargs -i cp path/file.txt {}/.file.txt 

    b_directory path to root directory

    path/file.txt - the path to the file to be copied

    {}/.file.txt - instead of file.txt, substitute the name of the final file

    As a result, the file.txt file will appear in all directories nested in b_directory file.txt