LPIC-1 Exam 102 v5 (Linux Administrator) — Question 65
Which of the following commands finds all files owned by root that have the SetUID bit set?
Answer options
- A. find / -user root -perm -4000
- B. find / -user 0 -mode +s
- C. find / -owner root -setuid
- D. find / -owner 0 -permbits 0x100000000
- E. find / --filter uid=1 --filter pers=u+s
Correct answer: A
Explanation
The correct command is A, as it specifically looks for files owned by the user 'root' with the SetUID bit set (indicated by -4000). Option B incorrectly uses '-mode +s', which is not valid syntax for finding SetUID files. Option C uses '-setuid', which is not a recognized option in the find command. Option D uses '-permbits' incorrectly and does not target the SetUID bit specifically. Option E uses filters that are not standard for finding SetUID files.