There are two ways to find files:
First, locate: not real-time search, fuzzy matching, search based on system-wide file database; fast
# UpdateDB: is to manually generate a file database; fast
Second, find: real-time search, accurate matching, support a number of lookup standards, traversing the specified directory of all files to complete the search; slow
Use of the Find command
Find lookup Path Lookup standard lookup to later processing operations
Find path: Default view current directory
Find criteria: Default to all files under the specified path
Processing operations: Default to display
Its matching criteria:
-name ' filename ': exact Match of filename
FileName Wildcard:
*: Any length
?: any single character
[]: matches any single character within the specified range
[: Space:]: blank characters
[:p UNCT:]: Punctuation
[: Lower:]: Small Letter
[: Upper:]: Capital letters
[: Alpha:]: Uppercase and lowercase letters
[:d Igit:]: Digital
[: Alnum:]: Numbers and uppercase and lowercase letters
Example: # find/etc-name ' passwd* '--> find files that begin with passwd in/etc directory
-iname ' filename ': filename matching is case-insensitive
-regex pattern: File name matching based on regular expressions
-user USERNAME: Based on the owner lookup
Example: # find/tmp-user student--> Find files that are subordinate to the/tmp directory student
-group groupname: Find by group
-uid uid: Finding by UID
Example: # Find/tmp-uid 2003--> find files with a UID of 2003 in the/tmp directory
-gid GID: Lookup based on GID
-nouser: Find files that are not owned by the owner
Example: # Find/tmp-nouser--> Find files with no owners in/tmp directory
-nogroup: Find files with no group
-type: Find by File type
File type:
F: Ordinary Documents
D: Catalog Files
B: Block device files (blocks)
C: Character device file (character)
L: Symbolic link eh file (pipe)
P: Command pipe file (pipe)
S: Socket file (socket)
Example: # Find/tmp-type F--> Find common Files in the/tmp directory
-size: Find [+|-] based on file size
(11M is greater than 10M less than or equal to 11M)
# k
# M
# G