Bird
0
0

Which of the following is the correct syntax to change the owner of a file named file.txt to user alice?

easy📝 Syntax Q12 of 15
Linux CLI - File Permissions and Ownership
Which of the following is the correct syntax to change the owner of a file named file.txt to user alice?
Achown -owner alice file.txt
Bchown file.txt alice
Cchown alice file.txt
Dchown -u alice file.txt
Step-by-Step Solution
Solution:
  1. Step 1: Recall the basic syntax of chown

    The correct syntax is chown USER FILE, so the user comes first, then the file.
  2. Step 2: Check each option

    chown alice file.txt matches the syntax. Options A, B, and C use incorrect order or invalid flags.
  3. Final Answer:

    chown alice file.txt -> Option C
  4. Quick Check:

    Syntax: chown USER FILE [OK]
Quick Trick: User name comes before file name in chown [OK]
Common Mistakes:
MISTAKES
  • Swapping user and file order
  • Using invalid flags like -u or -owner
  • Forgetting to specify the user

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes