1

Copying a single file to multiple directories using cp

view story
linux-howto

http://unix.stackexchange.com – This question is a sequel of sorts to my earlier question, Creating numerous directories using mkdir. I am using the bash shell. I have created fifty directories, each starting with the prefix "s", using the command: mkdir $(printf "s%02i " $(seq 1 50)) which pads to the second digit with zeros. That is, the directories that I obtain are of the form s01, s02, ..., s49, s50. Now I would like to use cp to copy a single file (for example, test.txt) to each of the fifty directories. Is it possible to do this in a way analogous to that above? For example, would the following work? I am rel (HowTos)