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

Need help with Linux Server or WordPress? We can help!

Leave a Reply

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