Find the file mycprogram in the current directory and subdirectory. C # Find. -Name "mycprogram. C "Search for files without case sensitivity # Find. -INAME "mycprogram. C "Search does not contain mycprogram. c file find. -maxdepth 1-not-INAME "mycprogram. c"
Search for passwd # Find/-mindepth 3-maxdepth 5-name passwd in the subdirectories from Level 3 to level 5 under /.
Find and execute the command find.-INAME "mycprogram. c"-exec md5sum {}\;
Search for files larger than MB # Find ~ -Size + 100 m search for files smaller than M # Find ~ -Size-100 M: Search for files equal to M # Find ~ -Size 100 m
Find the maximum five files in the directory and subdirectory. -Type F-exec LS-s {}\; | sort-n-r | head-5: Find the minimum five files in the directory and subdirectory # Find. -Type F-exec LS-s {}\; | sort-N | head-5: Find the five files with a non-zero size and minimum size # Find. -Not-empty-type F-exec LS-s {}\; | sort-N | head-5
Find all files with write permissions for all users # Find.-Perm-G = W-Type F-exec LS-l {}\;
Find the files whose modification time is earlier than 5 days in the/logs directory and delete them $ find logs-type F-mtime + 5-exec RM {}\; search for Common files whose time is earlier than 7 days in the/var/logs directory, ask them $ find/var/logs-type F-mtime + 7-OK RM {}\ before deleting them {}\;
You can use a certain file name pattern to match the file. Remember to use quotation marks to cause the file name pattern. Otherwise, matching and expanding will cause confusion of the find parameter. $ Find.-Name [A-Z] *-printhttp: // www.linuxso.com/command/find.html
In the current directory, find the file with a permission of 755, that is, the file owner can read, write, and execute, and other users can read and execute the file. You can use $ find. -Perm 755-print
Http://yangdong.blog.51cto.com/2959198/546524
Http://www.cnblogs.com/itech/archive/2011/04/25/2027725.html
Complete!