Basic Linux Tutorial
Computer Tutorial

Permissions of Linux files



Permissions of Linux files

Every file and directory in Linux / UNIX system has following 3 permissions for user, group and other.
» Read :
This permission give you the authority to open and read a file. Read permission on a directory gives you the ability to lists its content.
» Write :
The right permission gives you the authority to modify the contents of a file. The write permission on a directory gives you the authority to add, remove and rename files stored in the directory. Consider a scenario where you have to write permission on file but do not have write permission on the directory where the file is stored. You will be able to modify the file contents. But you will not be able to rename, move or remove the file from the directory.
» Execute :
In Windows, an executable program usually has an extension ".exe" and which you can easily run. In Unix/Linux, you cannot run a program unless the execute permission is set. If the execute permission is not set, you might still be able to see/modify the program code(provided read & write permissions are set), but not run it.

Ownership of Linux files

Ownership of Linux files

The permission in the command line is displayed as :
rwx rwx rwx 1 owner : group
The characters are pretty easy to remember :
r   -   read permission
w   -   write permission
x   -   execute permission
-   -   no permission

Ownership of Linux files

User rights/Permissions :
1. The first set of three characters (rwx) is for the owner permissions.
2. The second set of three characters (rwx) is for the Group permissions.
3. The Third set of three characters (rwx) is for the All Users permissions.