Find
Find is the most common and powerful find command, finding a file on disk, using it to find any file you're looking for, which is a bit slow.
Find Path-option [-print] [-exec-ok command] {} \;
Path is the file, option is the parameter, [] the content is optional;
#-print output of the found file to standard output
#-exec command {} \; The command operation-----The file to be traced, with a space between {} and \;
#-ok and-exec are the same, except to consult the user before operation
Find command parameters:
-name filename #查找名为filename的文件
-perm #按执行权限来查找
-user username #按文件属主来查找
-group GroupName #按组来查找
Find by Size:
Find/-size 1500c (look for a 1,500-byte file, c for bytes)
Find/-size +1500c (finds files larger than 1,500 bytes, + represents greater than)
Find /-size-1500c (finds files less than 1,500 bytes in size-Indicates less than)
Search by Time:
In the Linux operating system, each file has a lot of time parameters, of which three are compared to the main, respectively, Ctime,atime,mtime
Modification Time (mtime):
When you modify the content data of the file, it will update the time, and change the permissions or properties, Mtime will not change, this is the difference with CTime
-mtime-n +n #按文件更改时间来查找文件,-n means n days or less, +n means n days ago
Status Time (CTime)
This time is updated only if the properties or permissions of the file are updated, and the time is not updated when the content is changed.
-ctime-n +n #按文件创建时间来查找文件,-n means n days or less, +n means n days ago
Accesstime (atime)
Atime: Access time, which is the time at which the file was last read
-atime-n +n #按文件访问时间来查文件,-n means n days or less, +n means n days ago
Search commands in Linux