Question 561 of 750
Linux Commands and File PermissionshardMultiple ChoiceObjective-mapped

How to Find All SUID/SGID Files Owned by Root in /usr/bin

This 220-1202 practice question tests your understanding of linux commands and file permissions. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A technician is investigating a privilege escalation vulnerability. They need to list all files in /usr/bin that have the SUID or SGID bit set and are owned by root. Which single command will achieve this?

Quick Answer

The answer is `find /usr/bin -user root -perm /6000`. This command is correct because it combines two essential conditions: it restricts the search to files owned by root using `-user root`, and it uses the `-perm /6000` syntax, which tells the `find` command to match any file that has either the SUID bit (4000) or the SGID bit (2000) set. The forward slash before the permission mask is a GNU extension that means “match if any of these bits are set,” making it the most efficient way to locate both privilege-escalation vectors in a single pass. On the CompTIA A+ Core 2 220-1202 exam, this question tests your understanding of Linux file permissions and security auditing, often appearing in scenarios about vulnerability investigations. A common trap is using `-perm -6000` (with a dash), which requires all bits to be set—a much rarer condition—or forgetting the `-user root` filter, which would return SUID/SGID files owned by any user. Memory tip: think of the forward slash as a “sieve” that catches files with either the 4 (SUID) or the 2 (SGID) bit, so “/6000” means “any of these six thousand bits.”

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

find /usr/bin -user root -perm /6000

Option D is correct because the `find` command with `-perm /6000` matches files where either the SUID (4000) or SGID (2000) bit is set, combined with `-user root` to restrict results to files owned by root. The `/` prefix in the permission mask tells `find` to match any of the specified bits, making it the precise single command for this task.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • find /usr/bin -user root -perm -6000

    Why it's wrong here

    This matches files with both SUID and SGID bits set (6000), not either one, so it would miss files with only SUID or only SGID.

  • find /usr/bin -user root -perm 4000 -o -perm 2000

    Why it's wrong here

    This is syntactically incorrect; the -o operator needs to be properly grouped with parentheses, and it does not combine the conditions correctly.

  • ls -la /usr/bin | grep '^...s'

    Why it's wrong here

    This uses grep to find SUID files but does not filter by owner root, and it does not capture SGID files correctly.

  • find /usr/bin -user root -perm /6000

    Why this is correct

    This correctly uses the / prefix to match files with either SUID or SGID bit set, and filters by owner root.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

CompTIA often tests the distinction between `-perm -mode` (all bits must match) and `-perm /mode` (any bit can match), and candidates frequently confuse the minus sign with the forward slash, leading them to pick Option A.

Detailed technical explanation

How to think about this question

The `find` command's `-perm` option with a `/` prefix (e.g., `/6000`) performs a logical OR of the specified permission bits, matching files that have any of them set. SUID (setuid, octal 4000) and SGID (setgid, octal 2000) are special permission bits that allow a process to run with the privileges of the file owner or group, respectively; listing them is a common security audit step to identify potential privilege escalation vectors. In real-world scenarios, misconfigured SUID/SGID binaries owned by root are a classic attack path for local privilege escalation (e.g., CVE-2021-4034 in pkexec).

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A junior network technician can log in to a core router but cannot reach the enable prompt or configuration mode. The AAA server is authenticating the login — but the authorisation policy only grants privilege level 1, not 15. Authentication (who you are) is working; authorisation (what you can do) is not.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related 220-1202 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 220-1202 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 220-1202 question test?

Linux Commands and File Permissions — This question tests Linux Commands and File Permissions — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: find /usr/bin -user root -perm /6000 — Option D is correct because the `find` command with `-perm /6000` matches files where either the SUID (4000) or SGID (2000) bit is set, combined with `-user root` to restrict results to files owned by root. The `/` prefix in the permission mask tells `find` to match any of the specified bits, making it the precise single command for this task.

What should I do if I get this 220-1202 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more ways this is tested on 220-1202

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A security incident response team needs to find all files in /var/www that have the SUID bit set, which may indicate a privilege escalation risk. Which command should they use?

hard
  • A.find /var/www -type f -perm 4000
  • B.find /var/www -type f -perm /4000
  • C.ls -la /var/www | grep '^...s'
  • D.chmod -R u+s /var/www

Why B: Option B is correct because the `find` command with `-perm /4000` matches any file that has the SUID bit set (the 4000 octal permission), regardless of other permission bits. The `/` prefix tells `find` to match if any of the specified permission bits are set, which is the precise way to locate files with the SUID bit enabled. This command will recursively search `/var/www` for regular files (`-type f`) with the SUID bit, helping identify potential privilege escalation risks.

Keep practising

More 220-1202 practice questions

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 220-1202 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 220-1202 exam.