Can ls be made to only list directories?

Randal Schwartz merlyn at iwarp.intel.com
Mon Sep 3 13:20:37 AEST 1990


In article <14171 at cbmvax.commodore.com>, ag at cbmvax (Keith Gabryelski) writes:
| Which will list all subdirectories also; which is probably not what
| Scott wanted.
| 
| 	$ ls -ld `echo */.`
| 
| is probably more in tune to what was requested.  CAVEAT: directories
| starting with `.' are not displayed.  Modify as needed.

A tip from someone who knows launching processes is expensive:

You *never* need

	`echo something`

Just use

	something

Think about it.  And that'd make your command line pretty close to mine
(at least *one* of mine :-), as in:

	$ ls -ld */.

Just another UNIX hacker,
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/



More information about the Comp.unix.questions mailing list