10. Find pathname-options [-print-Exec-OK]
1) to search for all '*. txt' files in the current directory and subdirectory, you can use: find.-Name "*. txt"-print
2), to the current directory and subdirectory to find the file name starting with an uppercase letter, you can use: find.-Name "[A-Z] *"-print
3) search by permission: find.-Perm 755-print
4) Ignore directory./leeboy: find.-path "./leeboy"-prune-o-name "*. cpp"-print (-O indicates or)
5) Ignore multiple directories. /leeboy ,. /LEE: Find. \ (-path. /leeboy-o-path. /LEE \)-prune-o-name "*. CPP "-print (-O indicates or)
6) Search for files with leeboy as the owner./folder: Find./-user leeboy-print
7) find.-mtime-1-print files within one day
8) to find files whose modification time is earlier than 2 days, you can use: find.-mtime + 2-print.
9) Search for files newer than FTW. C and older than remove. C, that is, files between FTW. C and remove. C: find.-newer FTW. C! -Newer remove. C-print
(The file time can be controlled through touch: Touch-T 08151056 leeboy time is set to August 15 10:56)
10) search by type: find.-type D-print folder type
11) files smaller than 10 bytes by file size: Find-size-10C-print. More than 10 files, one 512 bytes: find.-size + 10-print
12) execute the shell command on the found file: find.-newer rename. C! -Newer Unlink. cpp-exec LS-l {}\; the LS-l command is executed. (Only valid for files)
13) search in the search results # Include Specific field find.-Name "*. cpp"-print | xargs grep "# include ". Xargs efficiency is higher than-Exec: find.-Name "*. cpp"-exec grep "# include "{}\;