find command

The find command, which walks a directory tree and prints, or acts on, every entry that passes its tests.

In more detail

Tests such as -name, -type, -size, -mtime and -perm select entries, and -maxdepth limits how deep it goes. It prints results in the order it meets them, so sort the output when order matters. Quote patterns given to -name so find, not the shell, expands them.

Examples

find notes -name "*.md" -not -path "*archive*"
find dist -type f | sort
find environments -mindepth 1 -maxdepth 2 -type d | sort

Related terms

Taught in

References