Linux find folder inside subfolders
find
is what you need:
$ find -type d -name '*debugerror*'
or
$ find -type d -name '480debugerror'
if you are certain about the folder name.
find . -type d \( -iname '*error*' -o -iname '*debug*' \)
In bash,
shopt -s nullglob globstar
echo **/*480*/
echo **/*debug*/
echo **/*error*/
searches recursively for directories with names containing 480, debug or error.
locate -i "480debugerror"
will check a database that lists all the files indexed on your PC. I often have scenarios like this and so I do searches like:
locate -i "debug" | grep -i "log"
which finds all files that have in their path (regardless of case [that's what -i means]) "debug" and "log" (In case you don't know, the | grep
means search within the results that locate produces)
The advantage to using locate over find is that locate will produce output much faster (since it's only checking a database) but if the file/folder is not indexed then it will not find anything. (to update the database you can use sudo updatedb
)