Find command, find
Find
# Format: find [path] [parameter] [expression]-exec command {}\;
-{} Indicates the file found by find.
-\ Prohibit conversion; indicates that the instruction of the Bank has ended
# Find/sbin-type f-size + 1 M-exec ls {}\;
-- In the/sbin directory, find that the file type is regular and the file size is greater than 1 MB. Then run the ls command to check the file type.
# Find/sbin-type f-size + 1 M-exec cp {}/tmp \;
Parameters:
-Name: searches for files by file name.
# Find/-name "*. conf"
-Perm searches for files based on the file permissions.
# Find/-perm 755 | find/tmp-perm 755-ls
-The user searches for files based on the file owner.
# Find/-user student
-The group searches for files based on the group to which the files belong.
# Find/-group student
# Find/-user vip01! -Group upl_vip
-Newer file1! File2 searches for files whose change time is newer than file1 but older than file2.
# Find/home/-newer kk
-Type: search for a certain type of files, such:
B-block device files. D-directory. C-character device file. P-MPs queue file. L-Symbolic Link file. F-common file.
# Find/dev/-type B-ls
-Size n: [c] searches for files with a length of n blocks. If a file contains c, the file length is measured in bytes.
Find/etc/-size 585c c indicates the character-585c is smaller than + 566c is greater
Find/tmp/-size 2 greater than 2-2 less than 2