10 July 2011

chmod permissions explained via @ghacks http://goo.gl/xkVjZ

Remember, file permissions are in the form:

OWNER | GROUP | All Others

Each of those sections includes:


Each permission (read, write, execute) is represented with the binary representation of the initial letter:

r – 4
w – 2
x – 1
To get the numeric permission you add which permissions you want to use together. So if you want r+w you get 6. If you want r+w+x you get 7. If you want r+x you get 5. If you want only r you get 4. So now, remembering you have to cover permissions for three different users (Owner, Group, All Others), you will need to have a numeric number for each. So if you want Owner and Group to have rwx permission and All Others to only have r permissions, you would have:


Now, to change the permission of a particular file to 774 you would issue the command:

chmod 774 FILENAME

Where FILENAME is the name of the file.

via www.ghacks.net

No comments:

Post a Comment