Server Fault is a question and answer site for system and network administrators. 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

I want to see similar output like:

ls -l /etc/php5/php.ini

Which would give me:

-rw-r--r-- 1 root root 40344 Jun 14 14:33 /etc/php5/php.ini

Except the file in question is a directory, and doing ls -l on it would list it's contents.

How can I have it give me that permissions/info for a directory, or is there a better way?

share|improve this question
up vote 8 down vote accepted

Use ls -ld for directories. Quoting from the man page:

-d, --directory
list directory entries instead of contents, and do not dereference symbolic links

share|improve this answer

Use stat dirname - just to be different!

share|improve this answer
+1 for originality ;) – Jacek Konieczny Jun 24 '10 at 6:31
Here's another one just to be different: find /path/to/parent/dir -maxdepth 1 -type d -name dirname -ls – Dennis Williamson Jun 25 '10 at 2:30

Use the -d option:

ls -ld dirname
share|improve this answer
Ho, you beat by 13s me this time ;) – radius Jun 23 '10 at 23:35

use the d flag

ls -ld directory_name
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.