Limit find depth
Snippet
Posted by kitt at 12:45 on 1 September 2019
Limit the depth of find
for checking only some subdirectories instead of all of them by using -maxdepth
.
You can also use -mindepth
to sandwich directory levels.
# same as finding all files one level down, similar to "ls ./??*" find . -maxdepth 1 -type f # find all sub-subdirectories in the current directory find . -maxdepth 2 -mindepth 2 -type d
Add new comment