[olug] list just directories and not files

Dave Weis djweis at internetsolver.com
Fri Sep 2 03:48:10 UTC 2005



Try
find . -type d -maxdepth 1 -exec chmod a+x {} \;

dave

Brian Wiese wrote:
> Is there a way in unix to list "just the directories" and none of the 
> other files?
> 
> I could use a "find . -type d -maxdepth 1" but I'd also like to list the 
> permissions of these directories, then of course quickly change them to 
> make them all executable.
> 
> Any suggestions? =)
> 
> And note, "ls -d" does not work like I think it should, I can only use 
> it on specific directories to see permissions, like "ls -ld Maildir"
> 
> Brian
> 
> 
>          List Files and Directories
> 
>    ls /directory-name/ - list contents of directory
> 
>    options:
>        -a list all files including invisible files
>        -l long list - shows ownership, permission, and links
>        -t list files chronologically
>        * -f * append "*" to executable file name, "/" to directory name
>        * -d * list directories
>        * -u * list files using time of last access instead of time of
>        last modification
>        * -F * mark directories with forward slash, mark executables
>        with an @-sign.
>        * -g * lists ownership of each file or directory
> 
> 
> 
> Brian
> 




More information about the OLUG mailing list