Detailed description of the find command in linux
Find
Search
It is a real-time Feature and does not require a database. It is relatively slow.
1. Recursively search for files in a specified path
2. Search by various criteria
3. Support for further instructions on searched files
Syntax: # find [path] [parameter] [expression]
Common Parameters
-The user searches for files based on the file owner.
# Find/root-user root: find the file whose owner is root in the root directory
-Group: searches for files based on the group to which the files belong.
# Find/root-group root search for files whose group is root in the/root folder
-Nouser: Find files without the file owner, for example, some Trojans, but note that some linux system files have no users.
# Find/etc-nouser
-Nogroup: searches for files without groups. The principle is the same as-nouser.
# Find/etc-nogroup
-Name: search by file name
# Find/ect-name services search for a file named service under etc
-Size: searches for Objects Based on their sizes.
# Find/etc-size + 1000 k search for files larger than 1 MB
-Type: Find the file based on the file type. General files use f, character c, block file B, Directory d, link l
# Find/root-type f: find a common file of the file type
-Atime + n: files accessed or executed for more than n days
-Ctime + n files whose write and inode attributes (change owner, permission, or connection) are longer than n days
-Mtime + n: file with a write time greater than n days
-Exec outputs the find search result to the subsequent command as the input. For example.
# Find./-mtime + 10-exec rm-rf {}\; find and delete files created in the current directory for more than 10 days
In this command, {} is used as an alternative to the file found earlier. The '\' is ';' is followed by an escape character. Otherwise, shell uses a semicolon as the end of the command for this line.
-Perm searches for Objects Based on their permissions.
# Find/home-perm 600