1

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?

4 Answers 4

8

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

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

5

Use stat dirname - just to be different!

1
  • Here's another one just to be different: find /path/to/parent/dir -maxdepth 1 -type d -name dirname -ls Jun 25, 2010 at 2:30
1

Use the -d option:

ls -ld dirname
0
1

use the d flag

ls -ld directory_name

You must log in to answer this question.

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