Bird
0
0

Identify the error in this command to list all users with UID greater than 1000:

medium📝 Debug Q6 of 15
Linux CLI - Users and Groups
Identify the error in this command to list all users with UID greater than 1000:
awk -F: '$3 > 1000 {print $1}' /etc/passwd
AComparison operator should be '=='
BNo error; command works correctly
CIncorrect field separator; should be comma
DMissing quotes around the file name
Step-by-Step Solution
Solution:
  1. Step 1: Check field separator usage

    The /etc/passwd file uses ':' as delimiter, so -F: is correct.
  2. Step 2: Verify condition and print statement

    The condition '$3 > 1000' filters UIDs greater than 1000 and prints usernames ($1).
  3. Final Answer:

    No error; command works correctly -> Option B
  4. Quick Check:

    Correct field separator and condition = No error; command works correctly [OK]
Quick Trick: Use -F: for colon-separated files like /etc/passwd [OK]
Common Mistakes:
MISTAKES
  • Using wrong delimiter
  • Using '==' instead of '>' for numeric comparison
  • Adding unnecessary quotes around filename

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes