Using find command to search at certain level of depth in given folder

by rajesh 2014-03-23 14:18:57

Find usually search the complete subfolder tree structure.

To make find search only at a certain depth level we can use maxdepth and mindepth option

find /home/ -maxdepth 2 -mindepth 2 -name *.zip


The above command will search for any file that ends with .zip only under /home/*/ folder it wont search beyond that.

If we have /home/test/test.zip and /home/test/test2/test2.zip, the above commain will only return
/home/test/test.zip
1182
like
0
dislike
0
mail
flag

You must LOGIN to add comments