A
A
anriko2020-08-23 17:19:27
SSH
anriko, 2020-08-23 17:19:27

What is the command to copy and delete a file to folders?

find ./*/public_html/dorozhnaja-razmetka -name "index.php" | xargs -n 1 cp ~/optimaservis.ru/public_html/dorozhnaja-razmetka/index.php

How to remake not to replace, but to copy the sect_inc_company-numbers.php file to the ./*/public_html folder of all subdomains?
that's right?
find ./*/ -f "public_html" | xargs -n 1 cp ~/optimaservis.ru/public_html/sect_inc_company-numbers.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-08-23
@anriko

find ~ -type d -name 'public_html' -exec cp ~/optimaservis.ru/public_html/sect_inc_company-numbers.php {} \;

Finds all child directories of the current user (without a depth limit) with the name public_html and copies the file there
~/optimaservis.ru/public_html/sect_inc_company-numbers.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question