Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to see a long listing for a single directory. When I type ls -lha, I see this:

drwxrwxr-x  4 username groupname 4.0K 2010-08-05 09:55 files
drwxrwxr-x  7 username groupname 4.0K 2010-08-05 14:25 trunk
drwxrwxr-x  8 username groupname 4.0K 2010-08-05 16:02 phpincludes
drwxrwxr-x 11 username groupname 4.0K 2010-07-26 12:31 phpMyAdmin-3.3.5-english

However, when I type ls -lha phpMyAdmin-3.3.5, I get a listing of the contents of the directory. How do I type the command so that I see only

drwxrwxr-x 11 username groupname 4.0K 2010-07-26 12:31 phpMyAdmin-3.3.5-english

? I want to do this with symlinked directories, so I can see where they're linked to, not their contents.

share|improve this question
add comment

1 Answer 1

up vote 13 down vote accepted
ls -lhad phpMyAdmin-3.3.5-english

The -d flag is used to tell ls that you want to show the properties of the given directory, not its contents.

share|improve this answer
    
Thank you so much! :D –  user394 Aug 18 '10 at 15:04
1  
This is basic stuff. Reading the manpage of the ls command is always a good idea. –  dZkF9RWJT6wN8ux Aug 18 '10 at 15:46
1  
Unix koan: How many lowercase letters are invalid switches to ls ? –  pjz Aug 18 '10 at 21:52
1  
@user394: "is there a way to search in them?" Yes. Press /, then enter a search term, then press return and man will jump to the first occurrence of the term in the manpage. You can then press / and return without a search term in between to jump to the next occurrence. –  sepp2k Aug 19 '10 at 16:51
1  
@sepp2k Of course, that behaviour is pager-specific. In most, you can also press n to go to the next occurrence. –  Chris Down Feb 9 '12 at 16:21
show 4 more comments

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.