nerdexam
Linux_Foundation

LFCS · Question #263

Which of the following find commands will print out a list of suid root files in /usr?

The correct answer is A. find /usr -uid 0 -perm +4000. The find command can locate files with specific permissions and ownership, such as SUID files owned by root.

Submitted by stefanr· Apr 18, 2026Essential Commands

Question

Which of the following find commands will print out a list of suid root files in /usr?

Options

  • Afind /usr -uid 0 -perm +4000
  • Bfind -user root +mode +s /usr
  • Cfind -type suid -username root -d /usr
  • Dfind /usr -ls *s* -u root
  • Efind /usr -suid -perm +4000

How the community answered

(47 responses)
  • A
    81% (38)
  • B
    2% (1)
  • C
    11% (5)
  • D
    2% (1)
  • E
    4% (2)

Why each option

The `find` command can locate files with specific permissions and ownership, such as SUID files owned by root.

Afind /usr -uid 0 -perm +4000Correct

The `find` command with `/usr` specifies the starting directory. `-uid 0` correctly identifies files owned by the root user (UID 0). The `-perm +4000` test correctly finds files where the SUID bit (octal 4000) is set, as `+` means 'at least one of the bits in the mode is set'.

Bfind -user root +mode +s /usr

`+mode +s` are not valid `find` primaries for permission checks; the correct syntax for SUID permissions involves `-perm`.

Cfind -type suid -username root -d /usr

`-type suid` is not a valid argument for the `-type` primary, and `-username` is not a standard `find` primary.

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

The `*s*` is a pattern for file names, not a permission test, and `-u root` is not the correct syntax for specifying user ownership.

Efind /usr -suid -perm +4000

`-suid` is not a standard `find` primary for locating SUID files; the correct way is to use the `-perm` primary.

Concept tested: find command for SUID files

Source: https://man7.org/linux/man-pages/man1/find.1.html

Topics

#find command#file permissions#SUID bit#user ownership

Community Discussion

No community discussion yet for this question.

Full LFCS Practice