Linux Command - File Permission
Linux makes sure only proper people can have access to the proper files.
/Linux-Command-File-Permission/
Permission
Permission Groups
- User(u) - unique user
- Group(g) - A collection of one or more users.
- Others(o) - others
Access levels
- Read(r) - permission to read the contents of the file
- Write(w) - permission to write or modify a file
- Execute(x) - permission to execute a file
To View Permission, use ls -l
command
sample output
1 | total 4.0K |
- the first character indicate it is a regular file
- the following set of three characters(rw-) indicate owner(in this case jimmy) has read write permission
- the next set of three characters(r–) indicate group(root) has read permission
- the next set of three characters(r–) indicate everyone has read permission
It is sometimes easier to use an octal number to prepresent the bit patterns
- r = 4
- w = 2
- x = 1
so for rw-r--r--
, the octal representation is 644.
Reference