Search for files using find
The find command is used in Linux to search for files in the directory tree starting from the location specified. It searches your filesystem live, which causes the command to run slower than the locate command.
The syntax of the command is:
find PATH EXPRESSION
The expression is a way of specifying what you want to find. You can search files by filename, size, permissions, group, UID, etc.
Here is a list of the most commonly used expressions:
We will go through a couple of examples. To find all files and directory that begin with so in our current directory, we can use the following command
To find files bigger then 300 bytes, use the following command:
To find files owned by a particular user:
To find files with specific permissions:
You can also combine two or more expressions:
In the example above we have found all files that have the permissions of 775 and begin with the letter t.