Find: Searching for a File or Directory
sudo find / -iname 'target_to_find' -type d
- Search Access Privileges:
sudoto search protected (root access only) files
- Search Depth:
/searches the whole file system while. This is the recommended parameter as usually you’re usually not sure which directory the file or sub-directory is located.
.searches within the current directory.
~/searches the “home” directory (and below) of the user you are logged in as
- Case Sensitivity:
-inameperforms a case-insensitive search while
-namedoes the opposite
- Search Target:
target_to_findstick between single quotes as a best practice
- Search Target Type: The
-typedirective is optional and the default value is
fwhich searches for file names.
dsearches for directory names