Setting File permission in Linux

There are three type of groups who can access a file in linux.

User: who created the file
Group: Group to which user belongs
Others: Other users (not belonging to above 2 categories).

To add/ modify permissions use following format

chmod u=rwx,g=rw,o=rx abc.txt

or a simpler option

chmod 765 abc.txt

Both of the above means same.

How to interpret these numbers

Read=4
Write=2
Execute=1

hence Read+Write+Exceite=4+2+1=7 or Read+ execute=4+1=5 and so on.

Leave a Reply

Your email address will not be published. Required fields are marked *