Linux file permissions

Linux file permissions

 

 7 = 4+2+1 (read/write/execute)
 6 = 4+2 (read/write)
 5 = 4+1 (read/execute)
 4 = 4 (read)
 3 = 2+1 (write/execute)
 2 = 2 (write)
 1 = 1 (execute)

 

 

E.g

 

chmod 666 myfile.txt   -> read/write by anybody.
chmod 755 myfile.txt   -> rwx for owner, rx for group and rx for the world.
chmod 777 myfile.txt   -> read, write, execute for all.