A Journey through Files and Permissions ๐
1. Create and Explore: A Simple File Adventure ๐๐
๐ Let's Start by Creating a File:
Begin your command line escapade by crafting a simple file using the trusty touch
command:
touch filename.txt
A file named 'filename.txt' has sprung into existence in your current directory.
The Power of ls -ltr:
ls -ltr
owner โ The owner of the file or application.
"chown" is used to change the ownership permission of a file or directory.
group โ The group that owns the file or application.
"chgrp" is used to change the group permission of a file or directory.
others โ All users with access to the system. (outised the users are in a group)
"chmod" is used to change the other users permissions of a file or directory.
As a task, change the user permissions of the file and note the changes after
ls -ltr
2.Write an article about File Permissions based on your understanding from the notes.
๐ Read (r): Allows seeing what's inside.
๐๏ธ Write (w): Grants the power to edit or add new things.
๐ Execute (x): Gives permission to run a file, like opening a treasure chest.
๐ต๏ธโโ๏ธ Decoding ls -ltr Output:
After typing ls -ltr
, you'll see a code like rw-r--r--
. Each part of this code represents permissions for the owner, group, and others.
๐ Owner: The creator with full control.
๐ฅ Group: Friends who share the file, with their own set of powers.
๐ Others: Everyone else, each with their level of access.
chmod 700 filename.txt
Read about ACL and try out the commands getfacl
and setfacl
๐ Exploring Access Control Lists (ACL):
Now, imagine adding a magical layer to permissions with Access Control Lists (ACL). Use two spells
๐ต๏ธ getfacl: To see the magical settings of a file.
getfacl filename.txt
This command reveals the detailed ACL settings for 'my_file.txt', showcasing specific permissions beyond the traditional trio.
๐ ๏ธ setfacl: To cast your own spells and grant specific access.
setfacl filename.txt
Here, you're granting the user 'user' read and write permissions through ACL.
See your files transform, allowing specific access beyond the traditional permissions.
Embark on this enchanted journey, where files, permissions, and spells come together in harmony. Happy magic-making in your digital kingdom! ๐๐งโโ๏ธ
Happy Learning..
Subscribe to my newsletter
Read articles from Asif Shaikh directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by