0
0
Linux CLIscripting~10 mins

chgrp (change group) in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to change the group of the file example.txt to staff.

Linux CLI
chgrp [1] example.txt
Drag options to blanks, or click blank then click option'
Aadmin
Bstaff
Cusers
Droot
Attempts:
3 left
💡 Hint
Common Mistakes
Using a username instead of a group name.
Forgetting to specify the group name.
2fill in blank
medium

Complete the code to change the group of all files in the current directory to developers.

Linux CLI
chgrp [1] *
Drag options to blanks, or click blank then click option'
Aadmin
Busers
Cstaff
Ddevelopers
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong group name.
Not using the wildcard * to select all files.
3fill in blank
hard

Fix the error in the command to recursively change the group of the directory project and all its contents to team.

Linux CLI
chgrp -[1] team project
Drag options to blanks, or click blank then click option'
AR
Br
Ca
Df
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase -r which is not recognized by chgrp.
Forgetting the recursive option.
4fill in blank
hard

Fill both blanks to change the group of file.txt to admins and show the command output.

Linux CLI
chgrp [1] file.txt && ls -l [2]
Drag options to blanks, or click blank then click option'
Aadmins
Bfile.txt
C-l
Dadmins.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong file name in the second command.
Confusing options with file names.
5fill in blank
hard

Fill all three blanks to recursively change the group of docs directory to editors, force no error messages, and list the directory contents.

Linux CLI
chgrp -[1] [2] editors docs && ls [3] docs
Drag options to blanks, or click blank then click option'
AR
B-f
C-l
D-r
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase -r instead of uppercase -R.
Omitting the force option -f.
Not using -l to list detailed file info.