Linux File Permissions

Linux OS Topics
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Linux File Permissions

Post by Neo » Wed Sep 30, 2009 11:02 pm

Linux files have there own permissions set-up. There are mainly there types of access permission:
  • Read
  • Write
  • Execute
There is permission set for the Owner, Group and Others. When you type " ll " you will get 10 set of values for each files eg: -rw-rw-r-- 1 name name 41333 Aug 18 22:57 jpg . The 1st bit denotes if its a directory or file. 2nd, 3rd and 4th bit is the owner's permission. 5th, 6th and 7th bit is group's permission and 8th, 9th and 10th bit is for other's permission. According to the example owner and group has read/write permission and other's have only read permission.
You can change the permission of a file. Try chmod 777 filename. This will give owner, group and other's full permission (read/write/execute) over the file.

Permission Sets
  1. Execute
  2. Write
  3. Write and Execute
  4. Read
  5. Read and Execute
  6. Read and Write
  7. Read, Write and Execute
Try chmod 700 filename. This will give the owner of the file full permission. The Group and other's will have no permission to access the file. Only the owner of the file can read, write or execute the file. If you want other and Group only to read the file you can give chmod 744 filename.
Post Reply

Return to “Linux”