Chown Exercises

chown Practice

Create a new file called chown.exercises.

Question: What are the default owner and group for the new file?

CLICK FOR ANSWER

student student

The student user owns the file.

The student user is a part of the student group.

Bonus Question: What is the command to view the file owner and group?

CLICK FOR ANSWER

ls -l chown.exercises

Change the chown.exercises file owner to the root user.

Question: What was the command?

CLICK FOR ANSWER

sudo chown root chown.exercises

Change the chown.exercises file group to the root group.

Question: What was the command?

CLICK FOR ANSWER

sudo chown :root chown.exercises

Change the chown.exercises file owner to student and group to student.

Question: What wast he command?

CLICK FOR ANSWER

sudo chown student:student chown.exercises

Note

After completing the exercises feel free to delete the chown.exercises file.