Copy a single file from main directory recursively across all directories within

Posted by chris on Super User See other posts from Super User or by chris
Published on 2012-09-23T09:18:26Z Indexed on 2012/09/23 9:40 UTC
Read the original article Hit count: 235

I'm on a dedicated server using CentOS, and on this server I have 5000+ directories in one main directory.

In the main directory I have an index.php. I would like to copy this index.php into all 5000+ directories, but the only way I know how is doing it manually.

Is there a way through the command line that I can enter something like cp and make it work from the directory? I'd copy it all the way down through all the directories and there sub directories within this main directory I am starting out in.

© Super User or respective owner

Related posts about linux

Related posts about filesystems