Find limit search depth

Written by Yujin Boby

Edit in WordPress

I wanted to find some files inside the subdirectory of the current folder. To do this, find have maxdepth option.

find ./ -maxdepth 2 -name '*.gz'

This command will limit search depth to the current directory and all first-level sub folders.

See find