1. Find-name Find Files by name
- * Wildcard all characters;
- ? Wildcard single character
2. Find-iname is case-insensitive by name
3. find-size according to file size
- Find/-size +2048000 greater than 100m;# + means more than
- Find/-size-2048000 less than 100M: #-Indicates less than
- Find/-size n2048000 equals 100M; # n means equals
4, Find-user/group According to create a user name or group to find files
5. find-cmin-5 Find files and directories that have been modified in 5 minutes
- -amin: Accessing Time Access
- -cmin: File attribute change
- -mmin: File content Modify
6, find-type:f file, d directory; l link
7, find find to link multiple conditions,-a two conditions at the same time,-o two conditions to meet any one
Find/etc-size +1024000-a-size-2048000
8. Find "directory"-name "FileName"-exec [Execute command] {} \ (for example: Find/etc-name inittab-exec ls-l {} \;)
- -exec/ok represents the command to be executed later, when OK is executed, each queried record asks for an action if the operation is performed.
- {} indicates that the result of Find lookup is realized
- \ means escape character
- ; Indicates the end of a command
For example:
[Email protected] test_paul]# Ll/mnt/test_paul
Total 4
-rw-r--r--. 1 root root Jan 06:21 test.sh
[Email protected] test_paul]# Find/mnt/test_paul-type d-exec ls-l {} \;
Total 4
-rw-r--r--. 1 root root Jan 06:21 test.sh
9. Find "directory"-inum "num": Based on the file I node, num is the I node of the file
Search for Linux learning command find