Issue
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?
Solution
There is the -mindepth
option:
find -mindepth 1 -type d -execdir touch '{}'/someFile \;
Answered By - frippe Answer Checked By - Senaida (WPSolving Volunteer)