Bird
0
0

What will be the output of ls -l myfile.txt after running sudo chown john:staff myfile.txt?

medium📝 Command Output Q4 of 15
Linux CLI - File Permissions and Ownership
What will be the output of ls -l myfile.txt after running sudo chown john:staff myfile.txt?
A-rw-r--r-- 1 john staff 1234 date myfile.txt
B-rw-r--r-- 1 root root 1234 date myfile.txt
CPermission denied
DNo such file or directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand the effect of chown john:staff

    This command changes the owner to 'john' and group to 'staff' for 'myfile.txt'.
  2. Step 2: Predict ls -l output

    The output shows permissions, number of links, owner, group, size, date, and filename. Owner and group will be 'john' and 'staff'.
  3. Final Answer:

    -rw-r--r-- 1 john staff 1234 date myfile.txt -> Option A
  4. Quick Check:

    Owner/group changed = C [OK]
Quick Trick: ls -l shows updated owner and group after chown [OK]
Common Mistakes:
  • Expecting permission changes
  • Thinking ownership change fails without sudo
  • Confusing error messages

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes