Search for Linux system configuration and service management files
File lookup
Which: command lookup
Find: file lookup, for file name
Locate: file lookup, dependent on database
I. search for command files
Find the location of the ls command
Which ls / / from the PATH environment variable or # whereis vim
2. Arbitrary documents
Find
Grammar
Find [path...] [options] [expression] [action]
Command path option expression Action
① by file name:
[root@qianfeng ~] # find / etc-name "hosts"
[root@qianfeng ~] # find / etc-iname "hosts" find / etc-iname "HOSTS"-I ignore case I can ignore case to find
[root@qianfeng] # find / etc-iname "hos*" there is love in my heart (I), everything can be found
Result output / etc/hosts file found successfully
② by file size: [root@qianfeng ~] # find / etc-size + 5m file > 5m where "size" means size [root@qianfeng ~] # find / etc-size 5m file = 5m [root@qianfeng ~] # find / etc-size-5m file