Locate non-real-time, fuzzy matching, based on the file system database to find;
UpdateDB: Generate the file database graphically, which is generated automatically at a fixed time of day, or can be generated manually using this command.
/var/lib/mlocate/mlocate.db
yum install -y mlocate
The Locate command is actually another form of find-name.
Whereis
the Whereis command can only be used for program name searches, and only binary files (parameter-B), man description file (parameter-m), and source code file (parameter-s) are searched. If the argument is omitted, all information is returned.
Whereis [-
sbmu ] [-SBM dir ...-f] name ...
- B: Only binary files are found;-b< directory;: Find binary files only in the directory you set ;-F: The path name before the file name is not displayed;- m: Find only documentation;-m< directory;: Find the description file only in the directory of the settings ;- S: Find only the original code file;-s< Directory > find the original code file only in the directory of the settings;-U: Finds files that do not contain the specified type.
Find real-time, accurate, and support for many search criteria
Find path to find the processing action after finding a standard lookup path: default to the current directory
Lookup criteria: Default to all files under the specified path
Handling actions: Default to show
Find standard-name "filename": Exact Match of file name
-iname "filename": Matching file names, not case-sensitive
-regex PATTERN: File lookups based on regular expressions
-user USERNAME: Searching based on the owner of a file
-group GROUPNAME:Search based on a file's genus group
-uid UID: Searching based on the UID of the file
-gid GID: File-based GID search
Note: Deleting a user, belonging to this user-owned master file will only retain the UID number
-nouser: No Owner
-nogroup: No group
-type: Specify file type-size: Specify file size [=|-] #10k
[=|-] #10m
[=|-] #10gFind-size 10kWill match the content between the 9k~10k
The lookup unit for the file time is the day-atime-mtime-ctime unit is the minute-amin
-mmin
-cmin
Find the file permissions-perm mood exact Match-perm-mood file permissions are fully inclusive mood match-perm/mood any one match
Combination Lookup-A: default, can Save-o: or-not:find/tmp-not-user user1-o-type D equivalent to Find/tmp-not \ (-user user1-a-type d\)
Action-print: Display (default)
-print0: No line break display
-ls: Similar to Ls-l
-ok
COMMAND{} \; User confirmation is required for each operationExample:Find-atime +5-ok mv {} {}.old \;
-exec
COMMAND{} \; no user acknowledgement required
Example:Find-atime +2-exec mv {} {}.old \;
{} filename placeholder
-path
PATH: Specify the path -prune: Delete
Remove a path
find /usr/sam -path "/usr/sam/dir1" -prune -o -print
find [Path Expreesion]-a [ path expreesion]- o [path expreesion]
This combination of expressions can be written in pseudo-code
if -path "/usr/sam";then
-prune
else
-print
fi
From for notes (Wiz)
Locate, Whereis and find for file lookups