nerdexam
Linux_Foundation

LFCS · Question #469

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

The correct answer is A. find /usr -uid 0 -perm +4000. To find SUID files owned by root in the /usr directory, the find command requires specifying the search path, the root user's UID, and the SUID permission bit.

Submitted by chen.hong· Apr 18, 2026Essential Commands

Question

Which of the following find command 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

(50 responses)
  • A
    92% (46)
  • C
    2% (1)
  • D
    4% (2)
  • E
    2% (1)

Why each option

To find SUID files owned by root in the `/usr` directory, the `find` command requires specifying the search path, the root user's UID, and the SUID permission bit.

Afind /usr -uid 0 -perm +4000Correct

This command correctly specifies the search path (`/usr`), the owner's user ID (0 for root with `-uid 0`), and the SUID permission bit (`-perm +4000`), which finds files with the SUID bit set.

Bfind -user root +mode +s /usr

The `+mode +s` syntax is not a valid `find` predicate for specifying permissions; `find` uses `-perm`.

Cfind -type suid -username root -d /usr

`-type suid`, `-username root`, and `-d /usr` are not valid `find` options or predicates.

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

`-ls *s*` is not a valid `find` option for matching SUID files, and `-u root` is not the correct syntax for specifying a user.

Efind /usr -suid -perm +4000

While `-perm +4000` is correct for the SUID bit, `-suid` is not a standard `find` predicate, and the owner still needs to be explicitly specified (e.g., `-user root` or `-uid 0`) to find *SUID root* files.

Concept tested: Finding SUID files with `find`

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

Topics

#find command#File Permissions#SUID files#Root user

Community Discussion

No community discussion yet for this question.

Full LFCS Practice