[find] Exclude shallower paths with -mindepth

Created on November 30, 2026

Use -mindepth to skip paths above a specified depth. The starting point is depth 0. Suppose the files are laid out as follows.

sample/
├── root.txt
└── level1/
    ├── one.txt
    └── level2/
        └── two.txt

This command lists regular files at depth 3 or greater.

find sample -mindepth 3 -type f | sort
sample/level1/level2/two.txt

-type f selects regular files. The sort keeps the display order consistent. Use -maxdepth to specify an upper bound.

Reference

Shell command find