Linux Basics

58 / 107

What is numeric equivalent of rwxr-x--x?


Note - Having trouble with the assessment engine? Follow the steps listed here


Please login to comment

11 Comments

ALWAYS KEEEP THE PERMISSION IN THE READ WRITE EXECUTE ORDER  (rwx)    !!!!!

 

rwx = 421    or    4+2+1 =7

 

user   group others 

  |           |           |    

rwx    rwx         rwx

so it is written as rwxrwxrwx

From the above example if you want to remove the (write permission) for group  , ( read and write  permission ) for  others   , it will look something like this 

rwxr-x--x                    

---> solution to above example  rwxr-x--x 

access          u         g        o

binary          421     421     421

enable         111     101      001

----------------------------------------

Result        421       401      001

 

NOw add  all the results for ugo respectively    4+2+1=7  4+0+1=5  0+0+1

So The finaal Anser is  751

 7  Upvote    Share

This comment has been removed.

it should be like rwx-rx--x not rwxr-x--x

  Upvote    Share

Hi,

The correct representation is Read (r), then Write (w), and finally Execute (x). So, it's rwxrwxrwx.

Thanks.

 3  Upvote    Share

This comment has been removed.

rwxr-x--x into this whats the meaning of ' - '. As per my understanding ' - ' equal to Zero. Please confirm.

  Upvote    Share

Hi,

The '-' means that that permission is not given to that particular group. When calculating permissions as a numeric value, '-' is considered as zero, you are correct! I would suggest you to go through the previous topic once again if you need more understanding.

Thanks.

-- Rajtilak Bhattacharjee

 1  Upvote    Share

Explanation for beginners like me

 1  Upvote    Share

can someone explain this please??

  Upvote    Share

Its very simple,
Input: rwx r-x --x : I divided into 3 parts as one for user(owner), group and others respectively
Binary: 421421 421: Just represented as binary format to calculate the number
where ever '-' means that permissions are not given and hence we should put it as zero(0) and where permission are specified in given input then will have to take corresponding binary value and add it.
Owner Group Others
(r w x r - x - - x)
In this scenario (4+2+1 4+0+1 0+0+1)
which results to (7 5 1) without space(751). Enjoy the lengthy explanation.... Hope it clears your doubt. If not experts will help....

  Upvote    Share

No!! This i very clear. Thank you so much

  Upvote    Share