Find and search for Linux commands
Command: 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
-User can search for files based on the file owner # find/root-user root searches for files whose owner is root in the root directory
-Group: searches for files according to the file group # find/root-group root searches 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 files do not have users # find/etc-nouser
-Nogroup: searches for files without groups. The principle is the same as-nouser # find/etc-nogroup.
-Name: Search for files by file name # find/ect-name services search for files named service in etc
-Size: Search for files based on the file size # find/etc-size + k search for files larger than 1 MB
-Type: Find the file based on the file type. For general files, use f, character c, block file B, Directory d, link l # find/root-type f to find files whose type is normal
-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 files whose write time is longer 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 the file created in the current directory for more than 10 days and delete it. In this command, {} is used as an alternative to the previously found file, and "\" is "; ", otherwise the shell will use the semicolon as the end of the line command.
-Perm searches for Objects Based on their permissions. # find/home-perm 600 searches for objects with a permission of 600 and displays hidden objects.