Recall & Review
beginner
What does the
chgrp command do in Linux?The
chgrp command changes the group ownership of a file or directory to a specified group.Click to reveal answer
beginner
How do you change the group of a file named
report.txt to staff?Use the command:
chgrp staff report.txt to change the group ownership of report.txt to staff.Click to reveal answer
intermediate
Can
chgrp change the group of multiple files at once? How?Yes. You can list multiple files after the group name, like
chgrp staff file1.txt file2.txt, to change their group ownership all at once.Click to reveal answer
intermediate
What option do you use with
chgrp to change groups recursively for directories and their contents?Use the
-R option: chgrp -R staff /path/to/directory changes the group for the directory and all files inside it.Click to reveal answer
beginner
Who can change the group ownership of a file using
chgrp?Only the file owner or the superuser (root) can change the group ownership of a file using
chgrp.Click to reveal answer
What does the command
chgrp developers project.txt do?✗ Incorrect
The
chgrp command changes the group ownership of the file to the specified group.Which option allows
chgrp to change groups for all files inside a directory?✗ Incorrect
The
-R option makes chgrp work recursively on directories and their contents.Who can use
chgrp to change a file's group?✗ Incorrect
Only the file owner or the superuser (root) can change the group ownership.
What happens if you run
chgrp staff file1.txt file2.txt?✗ Incorrect
Listing multiple files changes the group for all listed files.
If you want to see what
chgrp is doing, which option should you add?✗ Incorrect
The
-v (verbose) option shows details of the changes made.Explain how to change the group ownership of a file and what permissions are needed.
Think about who owns the file and the command format.
You got /3 concepts.
Describe how to change the group ownership of all files inside a directory.
Consider how to apply changes to multiple files at once.
You got /3 concepts.