Searching for Files or Directories on Bash Shell
This Tutorial Tutorial Shows You Simply How-to Search for Files and Directories on Linux/Unix Command Line Shell.
There are 2 Main ways of Searching for Files or Directories on the Unix like Systems Shell.
The ‘find‘ Command (More time consuming always ready.)
find path/To/Root/Search -name "String*" 2>/dev/null
- And the ‘locate’ Command (Quicker but may Require of Updating the Search DB…)
How-to Update the locate Search DatabaseGuide on Updating locate DB
This will give you a List of all Files and Directories Containing the “String”
To Refine your Search you can use a Pipe with the “grep” Command
In practice you Filter your Search Results
locate String* | grep "*some/Thing*"
find path/To/Root/Search -iname "StRinG*" 2>/dev/null
The “2>/dev/null” mean: Don’t take in Compt the Errors than Can Stop the Searching process…