File Permissions in Linux/Unix - STUDY NOTES

Post Top Ad

File Permissions in Linux/Unix


Linux File Permissions

Basic File Permissions

Permission Groups

Each file and directory has three user based permission groups:

owner - The Owner permissions apply only the owner of the file or directory, they will not impact the actions of other users.

group - The Group permissions apply only to the group that has been assigned to the file or directory, they will not effect the actions of other users.

all users - The All Users permissions apply to all other users on the system, this is the permission group that you want to watch the most.


Permission Types

Each file or directory has three basic permission types:

read - The Read permission refers to a user's capability to read the contents of the file.

• write - The Write permissions refer to a user's capability to write or modify a file or directory.

execute - The Execute permission affects a user's capability to execute a file or view the contents of a directory.

The permission in the command line is displayed as: _rwxrwxrwx 1 

o rwxrwxrwx: Three sets of rwx. The leftmost set pertains to the owner, the middle set is for the group, and the rightmost set is for others; rwx stands for read (r), write (w), execute (x); the dash (–) means no permission.

o rwx——: Only the owner can read, write, and execute.

o rw-r–r–: Everyone can read, and the owner can also write.

o rw——-: Only the owner can read and write.

o r–r–r–: Everyone can read.


Permissions can also be expressed numerically, where read (r) is equal to 4, write (w) is equal to 2, execute (x) is equal to 1, and no permission is equal to 0. Therefore, rwxrwxrwx is equal to 777, rwx—— is equal to 700, rw-r–r— is equal to 644, rw——- is equal to 600, and r–r–r— is equal to 444.


The table below, gives numbers for all for permissions types.

Number
Permission Type
Symbol
0
No Permission
---
1
Execute
--x
2
Write
-w-
3
Execute + Write
-wx
4
Read
r--
5
Read + Execute
r-x
6
Read +Write
rw-
7
Read + Write +Execute
rwx



https://books2notes.blogspot.in/p/redirection-in-linuxunix.htmlhttps://books2notes.blogspot.in/p/linuxunix-pipes-grep-sort-command.html

No comments:

Post a Comment

Post Bottom Ad