Exam LFCS All QuestionsBrowse all questions from this exam
Question 137

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

    Correct Answer: A

    The correct command to find files owned by root and with the SUID bit set in /usr is 'find /usr -uid 0 -perm +4000'. In this command, '/usr' specifies the directory to search in, '-uid 0' specifies files owned by user ID 0 (which corresponds to the root user), and '-perm +4000' specifies files with the SUID bit set.

Discussion
mksarav

correct answer is (not listed in the options): $ find /usr -uid 0 -perm /4000

mksarav

all answers given are wrong. Tested on ubuntu. ~$ find /usr -uid 0 -perm +4000 find: invalid mode ‘+4000’ ~$ find -user root +mode +s /usr find: paths must precede expression: `+mode' ~$ find -type suid -username root -d /usr find: Must separate multiple arguments to -type using: ',' ~$ find /usr -ls \*s\* -u root find: paths must precede expression: `*s*' ~$ find /usr -suid -perm +4000 find: unknown predicate `-suid'

Greenmile84

I tested it also in Ubuntu, Debian, Alma. Same result, no answer is right