Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

I am having trouble understanding permissions for directories and files in LINUX.

By examining permissions for each of the following files, identify if it is a file or directory, and describe the access allowed to the world, user, and group:

  • a. -rwx---r-x
  • b. drwx------
  • c. -rwxrwxr--
  • d. dr-x---r-x
  • e. -rwx---rwx
share|improve this question

marked as duplicate by slm, manatwork, jasonwryan, vonbrand, rahmu Apr 30 '13 at 11:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

The permissions in the bit patterns you gave in your question are broken down as follows:

example #1

                             ss of permissions #1

example #2

                           ss of permissions #2

The bits are broken down thusly:

-                            rw-            ---              ---
^-- denotes a directory      ^-- user bits  ^-- group bits   ^-- other bits

Each pack of bits (user, group, other) contain 3 values.

  • r = read
  • w = write
  • x = executable

So a grouping of -rw-rw-r-- means it's a file with user & group read/write permissions, and other users have only read access. A grouping of drwxr-x-r-x means that it's a directory, and that the owner/user has read/write/execute permissions on the directory, and the group and others have only read and execute permissions.

Remember

The owner of a file/directory is the username listed in the 3rd column of ls -l output. The group that's associated to a file/directory is the 4th column, again a group called root. The Set of other users is basically anyone that doesn't fall into either of the first two categories (i.e. not the user root, not the group root).

$ ls
-rw-r--r--  1 root root     1749 Apr 14  2005 b
drwxr-xr-x  2 root root     4096 Dec 19 22:48 bin
drwxr-xr-x  2 root root     4096 Apr 10  2005 Desktop

Note on permissions bits

For simplicity sake I'm ignoring that there are in fact more potential bits than the standard r, w, and x. See the chmod wikipedia page for more details.

References

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.