I'm just doing this as an exercise in Linux but, I was wondering how could i use touch
to create one empty file and have it exist in multiple directories.
For example i have a directory layout like the followng:
~/main
~/main/submain1
~/main/submain2
.
.
.
~/main/submainN
How could i get the file created by touch
to exist in all of the submain
directories? My first thought is to have a loop that visits each directory using cd
and call the touch
command at every iteration. I was wondering if there was a more elegant solution?