Get the App
SLTechnology News&Howtos  ›  Servers  › 

Search for Linux system configuration and service management files

Shulou Source: shulou.com Published: 2022-06-03 05:33:56 11月14日 Update

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

Tags: File command size directory action file name permission volume key keyword depth environment syntax system ordinary precise successful three location inverse ratio Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information Microsoft NVidia Huawei