DEV Community

Hemant Patil
Hemant Patil

Posted on

Permission bits

In linux every file and directory has set of permission.

The structure contains 10 chracter of strings, that broken down into 4 parts.

1st character : Type , - for normal file , d for directory , l for symbolic link

charcter 2 to 4 : Permission for user.

character 5 to 7 : Permission for group.

character 8 to 10 : Permission for others.


basic permission are read , write and execute

kernel sees this as binary bits , binary is too hard for humans to read , thats why we use octal number representing the permissions.

rwx= 111 = 4+2+1  = 7
rw_= 110 = 4+2+0.  = 6
r-X = 101 = 4+0+1  = 5
r-- = 100 = 4+0+0  = 4



Example , if file1 has permission 755, then
7(Owner) Read , write , execute
5(Group) Read, execute
5(others) Read, execute



Managing permissions
chmod
umask.



Top comments (0)