Limit find depth


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

Find files of particular size


Say, find a file bigger than a megabyte.

$ find . -size +1M