LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   chmod (https://www.linuxquestions.org/questions/linux-newbie-8/chmod-882412/)

brownie_cookie 05-24-2011 04:48 AM

chmod
 
Hi all

A quick question :p (just want to be sure)

I'm used to this type of command
Code:

# chmod 755 file
but numbers don't say much...
so, what does that 755 represent?
Code:

# chmod +x file
???

colucix 05-24-2011 04:53 AM

They are octal numbers. If you consider a triplet of permissions
Code:

rwx
they correspond to 4, 2, 1 respectively:
Code:

421
If you sum these values you obtain uniquely identified permission sets. For example, you have:
Code:

rwx = 4 + 2 + 1 = 7
r-x = 4 + 0 + 1 = 5
rw- = 4 + 2 +0 = 6

The chmod command requires this sum for each of the three triplets so that 755 is the same as
Code:

rwxr-xr-x
421401401
 7  5  5

Hope this helps.

brownie_cookie 05-24-2011 05:00 AM

wow :D thanks !!!
it doesn't become more clearily than that ^^ !!


All times are GMT -5. The time now is 03:38 AM.