Which of the following find commands will print out a list of files owned by root and with the SUID bit set in /usr?

A.

find /usr -uid 0 -perm +4000

B.

find -user root +mode +s /usr

C.

find -type suid -username root -d /usr

D.

find /usr -ls \*s\* -u root

E.

find /usr -suid -perm +4000

题解

「find」指令可以搜索文件。加上「-uid」参数可以只搜索特定用户 ID 所拥有的文件,UID 0 表示 root。加上「-perm」可以只搜索拥有特定权限的文件,SUID 为 4,「+4000」(新版本要改用「/4000」)或是「-4000」都可以找到拥有 SUID 权限的文件。所以答案是选项 A。