Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to change the owner of the file example.txt to user alice.
Linux CLI
chown [1] example.txt Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the filename as the owner.
Using flags like -R instead of the owner name.
✗ Incorrect
The
chown command changes the owner of a file. To set the owner to alice, you write chown alice filename.2fill in blank
mediumComplete the command to change the owner of the directory docs and all its contents recursively to user bob.
Linux CLI
chown [1] bob docs Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the recursive flag and only changing the directory itself.
Using flags that do not affect recursion.
✗ Incorrect
The
-R flag tells chown to apply changes recursively to all files and subdirectories inside docs.3fill in blank
hardFix the error in the command to change the owner of file.txt to user carol.
Linux CLI
chown carol [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a flag instead of the filename.
Repeating the owner name instead of the filename.
✗ Incorrect
The filename
file.txt must come after the owner name to specify which file's ownership to change.4fill in blank
hardFill both blanks to change the owner to dave and the group to staff for the file report.txt.
Linux CLI
chown [1]:[2] report.txt
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping owner and group positions.
Using incorrect group names.
✗ Incorrect
To change both owner and group, use
owner:group syntax. Here, owner is dave and group is staff.5fill in blank
hardFill all three blanks to recursively change the owner to eve, the group to developers for the directory project.
Linux CLI
chown [3] [1]:[2] project
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Placing flags in the wrong order.
Forgetting the recursive flag.
Mixing up owner and group names.
✗ Incorrect
Use
-R for recursive. Owner and group go as owner:group. The recursive flag should come before the directory name.