how to search linux for a folder code example Example 1: terminal how to find a directory find . -type d | grep DIRNAME Example 2: search a folder in linux $ locate --basename '\pkg'