Recall & Review
beginner
What does the
chown command do in Linux?The
chown command changes the owner and/or group of a file or directory.Click to reveal answer
beginner
How do you change the owner of a file named
report.txt to user alice?Use the command:
chown alice report.txt to change the owner to alice.Click to reveal answer
intermediate
How can you change both the owner to
bob and the group to staff for a file data.csv?Use
chown bob:staff data.csv to change owner to bob and group to staff.Click to reveal answer
intermediate
What option do you use with
chown to change ownership recursively for all files and folders inside a directory?Use the
-R option, like chown -R alice folder/, to change ownership recursively.Click to reveal answer
beginner
Why do you need superuser (root) privileges to use
chown?Changing ownership affects system security, so only the superuser can change file owners to prevent unauthorized access.
Click to reveal answer
Which command changes the owner of
file.txt to user john?✗ Incorrect
The correct syntax is
chown owner filename. So chown john file.txt changes the owner to john.How do you change the owner and group of
doc.pdf to mary and editors respectively?✗ Incorrect
Use
chown owner:group filename to change both owner and group.What does the
-R option do in chown?✗ Incorrect
The
-R option applies ownership changes to all files and subdirectories inside a directory.Who can use
chown to change file ownership?✗ Incorrect
Only the superuser can change file ownership to maintain system security.
What happens if you run
chown alice file.txt but you are not root?✗ Incorrect
Without root privileges,
chown will fail with a permission denied error.Explain how to change the owner and group of a file using
chown. Include an example.Think about the format with colon separating owner and group.
You got /3 concepts.
Describe why changing file ownership requires superuser privileges and what could happen if it didn't.
Consider what ownership means for file access.
You got /4 concepts.