1.按照檔名查詢
(1)find / -name httpd.conf #在根目錄下查詢檔案httpd.conf,表示在整個硬碟查詢
(2)find /etc -name httpd.conf #在/etc目錄下檔案httpd.conf
(3)find /etc -name "*srm*" #使用萬用字元*(0或者任意多個)。表示在/etc目錄下查詢檔名中含有字串‘srm’的檔案
(4)find . -name "srm*" #表示當前目錄下查詢檔名開頭是字串‘srm’的檔案
2.按照檔案特徵查詢
(1)find / -amin -10 # 查詢在系統中最後10分鐘訪問的檔案(access time)
(2)find / -atime -2 # 查詢在系統中最後48小時訪問的檔案
(3)find / -empty # 查詢在系統中為空的檔案或者資料夾
(4)find / -group cat # 查詢在系統中屬於 group為cat的檔案
(5)find / -mmin -5 # 查詢在系統中最後5分鐘裡修改過的檔案(modify time)
(6)find / -mtime -1 #查詢在系統中最後24小時裡修改過的檔案
(7)find / -user fred #查詢在系統中屬於fred這個使用者的檔案
(8)find / -size +10000c #查找出大於10000000位元組的檔案(c:位元組,w:雙字,k:KB,M:MB,G:GB)
(9)find / -size -1000k #查找出小於1000KB的檔案
1.按照檔名查詢
(1)find / -name httpd.conf #在根目錄下查詢檔案httpd.conf,表示在整個硬碟查詢
(2)find /etc -name httpd.conf #在/etc目錄下檔案httpd.conf
(3)find /etc -name "*srm*" #使用萬用字元*(0或者任意多個)。表示在/etc目錄下查詢檔名中含有字串‘srm’的檔案
(4)find . -name "srm*" #表示當前目錄下查詢檔名開頭是字串‘srm’的檔案
2.按照檔案特徵查詢
(1)find / -amin -10 # 查詢在系統中最後10分鐘訪問的檔案(access time)
(2)find / -atime -2 # 查詢在系統中最後48小時訪問的檔案
(3)find / -empty # 查詢在系統中為空的檔案或者資料夾
(4)find / -group cat # 查詢在系統中屬於 group為cat的檔案
(5)find / -mmin -5 # 查詢在系統中最後5分鐘裡修改過的檔案(modify time)
(6)find / -mtime -1 #查詢在系統中最後24小時裡修改過的檔案
(7)find / -user fred #查詢在系統中屬於fred這個使用者的檔案
(8)find / -size +10000c #查找出大於10000000位元組的檔案(c:位元組,w:雙字,k:KB,M:MB,G:GB)
(9)find / -size -1000k #查找出小於1000KB的檔案