ls -C considered overkill (really ls follies)

Doug Landauer landauer at drivax.UUCP
Fri Aug 16 08:33:07 AEST 1985


chuq says:
>Do you realize that for all the billions and billions of options hacked
>into ls, I've never seen a version of ls that can sort files based on size?
>shoe size of the programmer maybe, but never file size.... 

Well, I wrote one five or six years ago when I was at INTERactive.
We had *seven* different versions of ls, each with a different set
of features accessible by a set of totally non-mnemonic lower-case
letters.  I think -x had three different meanings.  From the
glimpse I got of the PC/IX documentation, it seems to have been
renamed "li" for PC/IX.  If you have access to it, look at the
documentation for it.

We combined the options into a set of major and minor options,
where the major ones (e.g., what to sort on, how recursive to make
it, what fields to include) were in upper case, and their
"arguments" were lower case.   I still prefer the indented sort of
recursive listing it was able to print out over the ways both AT&T
& Berkely "ls" programs do it.

chuq also says:
> chuq (no, DON'T do it! please! We don't NEED another option....)

You're right, it is not difficult (for you or me) to figure out and
then remember to type
	ls -l | sort -r -n +4
and this feature is used seldom enough that it's not unreasonable.
I look at it as a performance tradeoff that depends on how well
one knows sort vs. ls.  Given that ls is one of the most-often
invoked programs in Unix, one tends to learn all of its features. 
So one is more likely to know enough to type
	li -lSs
than the somewhat more complicated sort command above.  I see
three disadavantages:
	1) this version of "li" is not standard (and is not
	   currently available for very many Unix versions),
	2) a bigger ls loads more slowly (even if its sticky bit is on)
	   in those simple cases that are its most common uses
	   (faster than a pipe, though),
   and	3) it is more complicated to learn all of its features.

Well, I liked it anyway!  So there!
--
			-- Doug Landauer --
	...[ ihnp4 | mot | ucscc | amdahl ] !drivax!landauer
		-- "I survived the DRI layoffs." --
			-- "(So far!)" --



More information about the Comp.unix.wizards mailing list