0812作業
1、查找/var目錄下屬主為root,且屬組為mail的所有文件
[root@CentOS 7 ~]# find /var -user root -a -group mail /var/spool/mail [root@CentOS 7 ~]# ls -ld /var/spool/mail/ drwxrwxr-x. 2 root mail 30 7月 24 02:36 /var/spool/mail/
2、查找/var目錄下不屬于root、lp、gdm的所有文件
[root@CentOS 7 ~]# find /var -not \( -user root -o -user lp -o -user gdm \) -ls 201328527 0 drwxr-xr-x 3 colord colord 16 7月 24 02:22 /var/lib/colord 8630 0 drwxr-xr-x 2 colord colord 6 11月 20 2015 /var/lib/colord/icc 67294209 0 drwx------ 2 setroubleshoot setroubleshoot 6 11月 20 2015 /var/lib/setroubleshoot 134301745 0 drwx------ 2 rpc rpc 6 11月 20 2015 /var/lib/rpcbind ………………下面省略……………………
3、查找/var目錄下最近一周內其內容修改過,同時屬主不為root,也不是postfix的文件
[root@CentOs6 ~]# date 2016年 07月 30日 星期六 21:15:29 CST [root@CentOs6 ~]# find /var/ -mtime -7 -a -not \( -user root -o -user postfix \) -ls 1179713 0 -rw-rw---- 1 user10 mail 0 7月 30 02:22 /var/spool/mail/user10 1179653 0 -rw-rw---- 1 rpc mail 0 7月 25 09:01 /var/spool/mail/rpc ……………………省略………………
4、查找當前系統上沒有屬主或屬組,且最近一個周內曾被訪問過的文件
[root@CentOs6 ~]# find /test/ -nouser -o -nogroup -a -atime -7 /test/aaa.sh
5、查找/etc目錄下大于1M且類型為普通文件的所有文件
[root@CentOs6 ~]# find /etc/ -size +1M -type f -ls 1181357 8228 -rw-r--r-- 1 root root 8424080 7月 25 09:05 /etc/selinux/targeted/policy/policy.24 1181354 8228 -rw-r--r-- 1 root root 8424080 7月 25 09:05 /etc/selinux/targeted/modules/active/policy.kern …………省略………………
7、查找/etc目錄下至少有一類用戶沒有執行權限的文件
[root@CentOs6 ~]# find /etc/ -not -perm -111 -ls 1180067 4 -rw-r--r-- 1 root root 3397 8月 23 2010 /etc/gconf/2/evoldap.conf 1180068 4 -rw-r--r-- 1 root root 1295 8月 23 2010 /etc/gconf/2/path …………省略………………
8、查找/etc/init.d目錄下,所有用戶都有執行權限,且其它用戶有寫權限的文件
[root@CentOs6 ~]# find /etc/init.d/ -perm -113 -ls 1181801 0 ---x--x-wx 1 root root 0 8月 13 14:24 /etc/init.d/test.txt 1179661 0 -rwxrwxrwx 1 root root 0 7月 30 10:50 /etc/init.d/f1
原創文章,作者:Lii,如若轉載,請注明出處:http://www.www58058.com/34743