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

Re: ls and directories only



"Lynn W" <lynn_wgnr@lycos.com> writes:

> 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?

I'd chant something like

  find . -name . -o -type d -ls -prune

(Which happens to be compatible with non-GNU finds, which I deal with
sometimes.)  Which is to say: search, starting with the current
directory.  If its name is '.', continue; otherwise, if it's a
directory, print a 'ls -l' line and don't recurse further.

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: