🐧In Linux, every file and directory has a set of permissions that controls who can access, modify or execute them. These permissions are important for maintaining security and ensuring that only authorized users can interact with files and directories.🧮
Users in Linux 👥
There are three types of users,
Owner / User: The person who creates or owns the file.
Group: Several users who share the same permissions for the file.
Others: It contains the remaining users who do not fall into the owner or group categories.
Permissions🔑
Each user can have these permissions for their access.
Read (r): They can view the files and directories.
Write (w): They can modify or delete the files and directories.
Execute (x): They can run the executable files.
How To Check These Permissions of The File or Directory?🛠️
When we execute the command ls -l
, it shows the permissions of all the files and directories in the present working directory.
To view the permissions of any specific file, simply add the filename at the end of this command.
Now see the first column, it displays the permissions in 10 bits. For demo.txt file, permissions are -rwxrwxrwx. The first bit represents whether it's a file or a directory. 'd' for directory and '-' for file. The remaining 9 bits are divided into three users (Owner, Group, Others)
This Image will explain to you how each file permission has different numbers associated.✨
Thanks for being till the end of the blog. I hope that this blog helps you to get an overview of different file permissions in Linux. We will see how we can change these permissions in the upcoming blog.