Real-time search tool, complete file search by traversing the specified path
Job Features
lookup is slow
Find exact
Find in real time
May only search directories where the user has read and execute permissions
Find conditions
-maxdepth level Maximum search directory depth, the default specified directory is the first level
-mindepth level Minimum search directory depth
[root@liang ~ 20:40:49]#find /data -maxdepth 3 -mindepth 3 -name f1
/data/d1/d2/f1
Find by filename and inode:
-name "filename": support using glob
*,?,[],[^]
Find files containing f1
[root@liang ~ 21:03:54]#find /data -name "*f1*"
/data/d1/d2/d3/f1
/data/d1/d2/f1
/data/d1/f1
/data/f1
/data/f11
[root@liang ~ 21:04:01]#find /data -name *f1*
/data/d1/d2/d3/f1
/data/d1/d2/f1
/data/d1/f1
/data/f1
-iname "filename": case insensitive
-inum n find by inode number
-samefile name file with the same inode number
-links n files with n links
-regex "PATTERN": match the entire file path string with PATTERN, not just the filename