I'm trying to cp
one file: index.php
into all subdirectories, and subdirectories of those subdirectories, and so on, so that every child directory of the root has index.php
I started with this:
for d in */; do cp index.php "$d"; done;
Which only worked for the top subdirectories. I tried to nest it in itself a few times like this:
for d in */; do cp index.php "$d"; for e in */; do cp index.php "$e";for f in */; do cp index.php "$f"; done; done; done
But that didn't seem to do anything
Try this :
find . -type d -exec cp index.php {} \;
-type d
find all dirs and sub-dirsIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With