bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: revised use of column space in "ls"


From: Paul Eggert
Subject: Re: revised use of column space in "ls"
Date: Thu, 20 Dec 2001 17:17:22 -0800 (PST)

> Date: Fri, 21 Dec 2001 00:48:41 +0000
> From: Markus Kuhn <address@hidden>
> 
> I still favour the use of a single full date and time, independent of
> the age of the file, just as MS-DOS DIR did.

ls --full-time does that.  But the output is too wide for many
applications.  Here is an example:

   $ ls --full-time .plan .profile today
   -r--r--r--    1 eggert   eggert        386 1981-07-14 16:01:39.000000000 
-0700 .plan
   -r--r--r--    1 eggert   eggert       4012 2001-11-20 11:03:15.645642000 
-0800 .profile
   -rw-rw-r--    1 eggert   eggert          0 2001-12-20 16:10:01.196841000 
-0800 today


> Today, most users have more screen space than what fits onto an IBM
> punch card.

They have more screen space, yes, but it is commonly cut up into
80-column windows.  It is often wasteful to have wider windows.
Screen space is still quite precious, even on the 1600x1200 displays
that are standard around here.  Our eyeballs have only so many
neurons....


> I want to know frequently, which of two 8 week old files
> is 10 seconds older than the other, for dependency checks.

ls -t will tell you that, and will do so far more reliably than humans
can do by visually parsing dozens of digits in --full-time output.


> Since "ls" has to read the entire directory in for sorting anyway, why
> not save column space by adapting the column widths to the actually
> needed widths, just as <TABLE> in HTML does?

That's on my list of things to do.  It conforms to POSIX, since POSIX
doesn't specify exactly how wide the columns are.

We could also remove the trailing zeros from the fractional part of
the time stamp.  (The example above was done on an old Netapp filer
that stores time stamps only to microsecond resolution, tsk tsk.  :-)

But screen space will still be at a premium, even after that change.


> The entire link count is probabaly redundant for most users

POSIX doesn't allow removing the link count, and removing it would
break some applications.  It is typically a handy way to see how many
subdirectories are in a directory, so it's not entirely useless.


> since multiple hard links are quite rarely used.

Maybe in _your_ shop they're rare, but they're pretty common around here:

$ ls -l
total 216
-r-xr-xr-x   41 eggert   src         31588 Feb  2  2000 Install.info
lrwxrwxrwx  903 eggert   src            22 May 18  2001 Make.file -> 
../:generic:/Make.file
-r--r--r--    1 eggert   src          3002 Jan 29  2001 README.110613-01
drwxrwsr-x    4 eggert   src           512 Nov 28  2000 SUNWdtpcv
drwxrwsr-x    4 eggert   src           512 Nov 28  2000 SUNWdtpcv.S26
-r-xr-xr-x   58 eggert   src         53238 Apr 26  2000 backoutpatch
-r-xr-xr-x   58 eggert   src        119239 Apr 26  2000 installpatch



reply via email to

[Prev in Thread] Current Thread [Next in Thread]