Find limit search depth

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

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *