File Search: Locate file name
Locate is through the database search, one day update, the day plus should use UpdateDB, update the database
Locate Locate
Locate Search background database:/var/lib/mlocate
can only be searched by file name, but relatively fast
/etc/updatedb.conf Search configuration file
Whereis command name
-B: Look only at the executable file location
-M: see only the Help document location
Can only look at commands that are not from the shell.
which file name
View aliases and command locations
$PATH environment variables, use; split
When you execute the command, go to the path contained in path to find
find [Range] [condition]
Find/–name Install
Search root, by file name
resource-intensive
Wildcard characters:
? Any one
* Any number of
[] One of the parentheses
-iname Case insensitive
-user Search Owner
Find/var/log/–mtime +10 to find Files modified 10 days ago
Atime File access time
CTime changing file properties
-Within 100 days
100 Day
-size 25k File size is exactly 25k, K is lowercase
M is uppercase, is trillion
Not write units is the data block, is a sector, a sector is 512 bytes
-inum number according to the I node number to search
-A logic with meaning
Find/etc–size +20k–a–size–50k to find files larger than 20k less than 50k
-O Logic or
The first command-exec the second command {} \;
Command Two can handle the results of a command search.
grep [Options] string file name
Search for a line in a file containing a string
-V does not contain a string of rows, take the inverse
-I ignores case
Linux Talent Formation program i--file Search command