我能否以特定的权限查看服务器上的所有文件?
我相信:
find / -type f -perm 0777
我知道以前的答案被接受,但我想发布这个“ 警告pipe理员 ”。 -perm 0777匹配确切的组合。 setuid / setgid文件是特殊的,所以我使用-perm -777也包括那些:
-----[ 19:19:33 ] (!4054) [ :-) ] janmoesen@purplepixelhost ~/bar $ for x in *; do printf "%4d %s\n" "$(stat -c %a "$x")" "$(ls -dalF "$x")"; done 777 -rwxrwxrwx 1 janmoesen janmoesen 0 2010-03-19 19:17 all-777* 644 -rw-r--r-- 1 janmoesen janmoesen 0 2010-03-19 19:17 normal-644 2777 -rwxrwsrwx 1 janmoesen janmoesen 0 2010-03-19 19:17 sgid-777* 4777 -rwsrwxrwx 1 janmoesen janmoesen 0 2010-03-19 19:17 suid-777* -----[ 19:21:34 ] (!4054) [ :-) ] janmoesen@purplepixelhost ~/bar $ find . -type f -perm 0777 ./all-777 -----[ 19:21:37 ] (!4054) [ :-) ] janmoesen@purplepixelhost ~/bar $ find . -type f -perm -777 ./all-777 ./suid-777 ./sgid-777
你的问题不清楚。 你说“观点”,但我认为你的意思是“发现”。
你想find具有特定权限的所有文件? 那会是这样的:
find . -type f -perm 777
这将find系统中所有用户可读,可写和可执行的所有文件。
在http://linux.about.com/od/commands/l/blcmdl1_find.htm#examples上查看一些示例