Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

4 Answers 4

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  
+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

 
discard

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.