Finding Files

Apr 2020

Overview

One thing I have always struggled with is finding things in CentOS. So here I am going to put a few examples, and over time hopefully add some more.

Examples

To find a file, use: find / -file “install.sh”
In the above example, the “/” is root, so find will look in root and all of its subfolders for a file called “install.sh”.
You can specify a location to search with find /home “filename.ext”
If you are unsure about the filename, but can remember some of it, a wildcard search might help: find / -name “myFile*”
Find files with the same extension: find / -name *.log
If you only wish to find folders then use -type d: find / name home -type d