練習1 查找/tmp下,不是目錄,並且還不能是套接字類型的文件
find /tmp -not -type d -a -not -type s -ls
練習2 /tmp/test 目錄下,屬主即不是user1 ,也不是user2的文件
find /tmp/test -not ( -user user1 -o -user user2 ) -ls
練習 3 查找/var目錄下屬主爲rott並且屬組爲mail的所有文件
find /var -user root -group mail -ls
練習4 查找/usr 目錄下不屬於root ,bin 或student的文件
find /usr -not -user root -a -not -user bin -a -not -user student
find /user -not ( -user root -o -user bin -o -user student )
練習 5 查找/etc/目錄下最近一週內內容修改改過且不屬於root及student用戶的文件
find /etc -mtime -7 -a -not ( -user root -o -user student ) -ls
練習 6 查找當前系統上沒有屬主或者沒有屬組且最近一天內曾被訪問過的文件,並將其屬主屬組均修改爲root
find / -atime -1 -a -nouser -o -nogroup -exec chown root.root {} \;
練習 7 查/etc目錄下大於1M的文件,並將其文件名寫入/tmp/etc.largefiles文件中;
find /etc -size +1M >> /tmp/largefile.txt
練習8 查找/etc/目錄下所有用戶都沒有寫權限的文件,顯示出其詳細信息;
find /etc -not -perm /222 -ls
find 命令基礎練習
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Centos下堡壘機Jumpserver V3.0環境部署
tianyu_7903
2018-09-11 02:52:39
centos 6.5 svn server 配置和安裝
tianyu_7903
2018-09-11 02:52:38
Linux--centos6.5 安裝nginx+tomcat 服務器整合
tianyu_7903
2018-09-11 02:52:38
linux 服務器初始化優化腳本
tianyu_7903
2018-09-11 02:52:38
linux zookeeper 集羣配置
tianyu_7903
2018-09-11 02:52:38
閏年腳本
tianyu_7903
2018-09-11 02:52:38
linux firewalld 防火牆簡單命令
tianyu_7903
2018-09-11 02:52:38
centos 6.5 安裝pure-ftpd + mysql
tianyu_7903
2018-09-11 02:52:38
tomcat_log 腳本編寫
tianyu_7903
2018-09-11 02:52:38
Centos6.5安裝rsyslog+loganalyzer+mysql部署日誌服務器
tianyu_7903
2018-09-11 02:52:02
centos6.5 nfs-server 配置實例
tianyu_7903
2018-09-11 02:51:59
centos 6.5 安裝配置 mantis
tianyu_7903
2018-09-11 02:51:59
linux centos6.5 安裝pptp-*** 服務器
tianyu_7903
2018-09-11 02:51:59
linux centos6.5 安裝memcached 和php擴展
tianyu_7903
2018-09-11 02:51:59
find 命令基礎練習
bruceweng
2018-09-10 02:46:25