For example, if I have a directory containing files file1 and file2, and a directory dir1, then "ls -l file1" will show details just for file1. Doing the same thing for dir1 will instead show the contents of dir1. Is there a way to treat dir1 like file1?

link|improve this question

71% accept rate
feedback

1 Answer

up vote 5 down vote accepted

Use ls -l -d dir (-d will make it stop listing the contents of a directory).

link|improve this answer
3  
Merging single-character parameters also works for ls, so ls -ld dir and ls -dl dir and ls -l -d dir all work equally well. – Trey Hunner May 17 '10 at 7:29
feedback

Your Answer

 
or
required, but never shown

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