how to search for a directory from the terminal in ubuntu

Posted on May 3, 2023

Question

I am using Ubuntu and I want to search for a specific Directory called "sdk".

All that I know is, that "sdk" Directory is located somewhere under /user Directory

how can I search for "sdk" Directory from the terminal?

I tried the following find / -name example docs -type d

but it says no such file or Directory.

Answer

you can search for directory by using find with flag -name

you should use

find /user -name "sdk" -type d

meaning find directories named sdk in or below the directory /user

or if you want to be case-insensitive

find /user -iname "sdk" -type d