Using find
and passing the results to touch
we can create a file -placeholder/dummy- in multiple dirs:
find . -type d -exec touch {}/someFile \;
however the find . -type d
also returns -and creates- a file in the current directory.
What would the command be to just create files in the sub dirs but not the current dir?
CodePudding user response:
There is the -mindepth
option:
find . -type d -mindepth 1 -exec touch {}/someFile \;