Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 command with which you can directly view the permission bits of a directory?

share|improve this question
up vote 21 down vote accepted

There's a couple ways. stat is used to show information about files and directories, so it's probably the best way. It takes a format parameter to control what it outputs; %a will show the octal values for the permissions, while %A will show the human-readable form:

$ stat -c %a /
$ stat -c %A /
$ stat -c %a /tmp
$ stat -c %A /tmp

Another (probably more common) way is to use ls. -l will make it use the long listing format (whose first entry is the human-readable form of the permissions), and -d will make it show the entry for the specified directory instead of its contents:

$ ls -ld /
drwxr-xr-x 22 root root 4.0K Apr 28 20:32 /
$ ls -ld /tmp
drwxrwxrwt 7 root root 12K Sep 25 22:31 /tmp
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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