Procedure for locating a qualifying file on a file system
File Lookup: Locate, find
Locate: A non-real-time lookup tool that relies on a pre-built index, and that the index is built automatically when the system is idle ( recurring task ) ; Manually update this database (updatedb) ; Find Fast; fuzzy search;
Find : Real-time search; search speed slightly slow; exact search;
Find command:
find [OPTION] ... [ Find path ] [ find condition ] [ processing Action ]
Find path: Default to the current path;
Search criteria: The specified search criteria, can be based on the file name, size, genus of the main group, type, etc., by default to find all the files under the specified path;
Handling actions: What to do with the eligible files; By default, output to the screen;
Find criteria
To find by file name:
-name " file name ": support for using Glob ;
*, ?, []
-iname " file name " : Character case insensitive, support for using Glob ;
-regex "PATTERN" : To PATTERN matches the entire file path string, not just the file name;
According to the genus, the genus Group looks for:
-user USERNAME: find files that belong to the specified user;
-group GROUPNAME:
-uid UserID: find the owner designation of a file UID of documents;
-gid GroupID:
-nouser: find files that are not owned by the master;
-nogroup : Find files that are not part of a group;
To find by file type:
-type type
F: Normal file
D: Catalogue
L: Symbolic Links
B: Block Devices
C: character Device
P: Named Pipes
S: Sockets
Combination Lookup criteria:
and Conditions: -A
or Condition: - o
Non-conditional: -not,!
! A-o! B =! (A-a B)
! A-a! B =! (A-o B)
Find command Usage summary