如何準確找到配置檔案的位置

2021-10-24 09:37:20 字數 1117 閱讀 4412

以zabbix為例

#find / -name zabbix_server.conf

/etc/zabbix/zabbix_server.conf

/usr/src/zabbix-4.2.8/conf/zabbix_server.conf

-name  限制查詢檔案的名字

例如: find /etc/ -name host 查詢/etc/目錄下名為host的檔案並輸出

find /etc -name *.conf 查詢/etc/目錄下所有以.conf結尾的檔案

-size 限制查詢檔案的大小

find /mnt -size 20k 查詢20k的檔案

find /mnt -size -20k 查詢小於20k的檔案

find /mnt -size +20k 查詢大於20k的檔案

-type 限制查詢檔案型別

find /mnt -type d 查詢目錄

find /mnt -type f 查詢檔案

-exec command

表示查詢到的檔案

例如:find /mnt -perm 444 -exec rm -rf \;整體這個命令的意思是,刪除/mnt下許可權為444的檔案

find /etc -name *.conf -exec cp -rp /mnt \;遞迴複製/etc下以.conf結尾的檔案到/mnt下

find /mnt -user tony ##查詢/mnt中所有者是tony使用者的檔案

find /mnt -group tony ##查詢/mnt中所有組是tony使用者的檔案

find /mnt -not -user student ##查詢/mnt中所有人不是student使用者的檔案

find /mnt -not -group student ##查詢/mnt中所有組不是student使用者的檔案

find /mnt -not -user student -o -group tony ##查詢/mnt中所有人不是student使用者或者所有組是tony使用者的檔案

Ubuntu 配置檔案位置

系統初始化 etc timezone 時區 etc inetd.conf 超級程序 檔案系統 etc fstab 開機時掛載的檔案系統 etc mtab 當前掛載的檔案系統 使用者系統 etc passwd 使用者資訊 etc shadow 使用者密碼 etc group 群組資訊 etc gsha...

ubuntu 配置檔案位置

系統初始化 etc timezone 時區 etc inetd.conf 超級程序 檔案系統 etc fstab 開機時掛載的檔案系統 etc mtab 當前掛載的檔案系統 使用者系統 etc passwd 使用者資訊 etc shadow 使用者密碼 etc group 群組資訊 etc gsha...

SpringBoot 配置 配置檔案載入位置

file config 即在專案根目錄下建立乙個config檔案,並且把配置檔案放在裡面 file 即把配置檔案放在專案根路目錄下 classpath config 把配置檔案放在resource包的子包config包中 classpath 把配置檔案放在resource包下優先順序由高到底,高優先...