:::| 目前位置圖示目前位置:首頁圖示回首頁 | 主功能頁圖示相關問答
find查詢檔案

[日期]:2018/06/28  [瀏覽人數]:376

find 的-type參數可以指定檔案類型
d:目錄,f:一般檔案,l:連結檔

如要搜尋abc.txt

find / -type f -name abc.txt

搜尋目錄abcd

find / -type d -name abcd

查詢.txt檔

find / -type f -name "*.txt"

查詢檔案權限 -perm

find / -type f -perm 0644

使用!:排除-o:或者

查SUID

find / -type f -perm -4000或find / -type f -perm /u=s

查SGID

find / -type f -perm -2000 或find / -type f -perm /g=s

查是SUID或SGIO另存成檔案

find / -type f -perm -4000 -o –perm -2000  -ls > ~/special.perm

find-type f -perm /u=s -o –perm /g=s  -ls > ~/special.perm