Introduction
This challenge will test your understanding of file permission management in Linux. You'll apply your knowledge of viewing and modifying file permissions and ownership, demonstrating your mastery of essential Linux commands.
Achievements
Upon completing this challenge, you'll have demonstrated proficiency in:
- Using
chownto change file ownership - Using
chmodto modify file permissions - Using
touchto create new files - Using
lsto view file details
Create a File
Your first task is to create a new file in the ~/project directory.
Tasks
- Create a file named
target_filein the~/projectdirectory.
Requirements
- Use the
touchcommand to create the file. - Ensure the file is created in the
~/projectdirectory.
Example
After completing the task, running the following command:
cd ~/project && ls
Should produce output similar to:
target_file
Change the File Owner and Group
For this step, you'll modify the ownership of the target_file you created.
Tasks
- Change the owner of
target_filetouser1. - Change the group of
target_filetogroup1.
Requirements
- Use the
chowncommand to change both owner and group. - The file owner must be set to
user1. - The file group must be set to
group1.
Tips
- You may need to use
sudobefore certain commands in this challenge.sudoallows you to execute commands with the privileges of the superuser (root).
Example
After completing the task, running:
ls -l ~/project/target_file
Should produce output similar to:
-rw-rw-r-- 1 user1 group1 0 Jul 29 10:59 target_file
Set the File Permissions
In this final step, you'll modify the permissions of target_file.
Tasks
- Set the permissions of
target_fileto-rwxrw----.
Requirements
- Use the
chmodcommand to change the file permissions. - The final permissions must be
-rwxrw----.
Example
After completing the task, running:
ls -l ~/project/target_file
Should produce output similar to:
-rwxrw---- 1 user1 group1 0 Jul 29 10:59 target_file
Summary
Congratulations on completing the file permission challenge! You've successfully demonstrated your ability to:
- Create files using
touch - Change file ownership with
chown - Modify file permissions using
chmod - View file details with
ls
These commands are fundamental to Linux file management and are used frequently in system administration tasks. Keep practicing and exploring to further solidify your skills in Linux file permissions and ownership management.



