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.

Possible Duplicate:
How can I make ls show information about the directory specified only, not info about its sub-files or folder contents?

I am new to UNIX and I want to display the permission for several directories without listing the permission for the files inside those directories.

I have the following directories - each of this directories contains a file inside them, for example :

Directory1
File1
Directory2
File2
Directory3
File3

I am using this command to list directories and their files : ls di* what should I add to this command to list the files permission of the directories without listing the files permissions?

share|improve this question

marked as duplicate by Gilles, uther, jasonwryan, Renan, warl0ck Jan 27 '13 at 7:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

If you use the -d option for ls, only the directory entries will be displayed. From the ls manpage:

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

For your example:

ls -ld Di*
share|improve this answer
    
thanks for the answer, using command ls -ld di* result in /usr/bin/ls: No match –  Andy M Jan 26 '13 at 5:59
    
@JohnSmith - Updated to match your example directory names. –  jordanm Jan 26 '13 at 6:02
    
thanks, it works. using this command instead of the ls -l just doesnt display the total # is that how you know the permissions are only for the directories and not the files? –  Andy M Jan 26 '13 at 6:10

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