I want to use the find command in linux to find a specific file nested within a specific directory structure, say dir1/dir2/reqdfile
.
But this directory structure can itself be nested within any parent directory structure.
Is it possible to a search like?
find directory_to_search -name "**/dir1/dir2/reqdfile"
What is the exact syntax?
Best Answer
Use
-path
instead of-name
:Note that there's only one asterisk.