[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ls and directories only



On Tue, Nov 18, 2003 at 11:38:21AM -0600, Lynn W wrote:
> Thanks, but how do I use
>     find -maxdepth 1 -type d
> to just display the directories in the current directory, and not to recurse
> into subdirectories, *and* to display all the directories' permissions?

find -maxdepth 1 -type d -exec ls -dl {} \;
or, if you don't want "hidden" directories :
find -maxdepth 1 -name '[^.]*' -type d -exec ls -dl {} \;

Perhaps the following is quicker to type/easier to remember, and
probably also quicker to run:
ls -l|grep '^d'

Frank

> Thanks very much!
> Lynn

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan



Reply to: