LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Permissions question (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-question-4175538529/)

doctore 04-02-2015 08:48 AM

Permissions question
 
Hello,

Just starting with Linux and I have a question about permissions. When I run ls on /bin/bash I get the following permissions output:

-rwxr-xr-x .......

Why are there 4 letters on the owner's permissions, namely the last "r" which I have put in bold? Since there are only 3 types - r, w and x, what's the point of the second "r" ?

Thanks

thegwer 04-02-2015 08:52 AM

That is actually the first permission of the middle set.

rwx | r x | r x
owner | group | other

doctore 04-02-2015 08:53 AM

Oh, I see. So the two dashes don't divide the sets. What's their purpose, then? Is it just to indicate that "w" is not given to group and users?

pan64 04-02-2015 08:58 AM

there are 3 letters: r, w, x. letter means it is set, - means it is not set.
So rwx the first group is for the owner, read, write and execute enabled
for the second and third group (group and others) r-x read and execute are enabled, write is disabled.

http://www.comptechdoc.org/os/linux/..._ugfilesp.html

thegwer 04-02-2015 08:59 AM

correct if the file was just read only by all groups it would be

chmod 444 would look like
r--r--r--

Or if it was the opposite

chmod 777 would look like
rwxrwxrwx

doctore 04-02-2015 09:00 AM

Perfect, thanks guys!


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