Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the ending r for and the leading d for in file permissions on Linux?

Example:

drwxr-xr-x

I know about the user, group, others part, and I know w=write, r=read, x=execute.

But I don't know about the leading d and the trailing r.

Can anyone explain how this works?

share|improve this question

migrated from stackoverflow.com Jun 1 '10 at 18:04

This question came from our site for professional and enthusiast programmers.

  • d means that the listing is a directory
  • r means the item can be read
  • w means the item can be written to (EG: modified)
  • x means the item can be executed (EG: a script or program)

There are three sets of rwx permissions, which correspond to (in order from left-to-right):

  • the current owner
  • the current group
  • other users
share|improve this answer

The leading d means the entry is a directory; other possibilities include:

I don't know what trailing r you're referring to, there isn't one in your example

share|improve this answer

The hyphens in your examples aren't separators. They're placeholders for where the w's would go, so show that "group" and "others" don't have Write permission.

drwxr-xr-x is read like this: d rwx r-x r-x

d - directory

rwx - user (owner) has Read, Write, and eXecute.

r-x - group has Read and eXecute (but not Write).

r-x - others have Read and eXecute (but not Write).

I think you were misreading the hyphens as separators between the u/g/o sections, like this:

drwxr - xr - x, which would explain why you thought the r's were "trailing".

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .