SLS 

short ls -l

MOTIVATION

I needed a program which could take 
the place of  ls -l  for a 40x15 
character LCD. So I wrote this one. I 
am releasing it so that others working
with small displays (visually 
impaired, wearables, embedded and
palmtop) do not have to write
their own version.

INSTALL

  make
  make install

OUTPUT

The  ls -l  I had only starts 
printing the file name at column 56. 
sls  starts printing the file name at
column 19 or 20, so half of the 
display is available for the file
name, reducing chances of wraparound.

The output consists of 4 fields, 
mode, time, size and name.

The mode is a 6 character string.
The first character indicates file
type:

  s - SOCKET
  l - LINK
  - - regular file
  b - BLOCK device file
  d - directory (content not listed)
  D - directory (content listed)
  c - CHARACTER block device
  f - FIFO

The second character provides 
file ownership clues:

  b - the user running  sls  is
      BOTH owner and belongs to the
      group owning the file
  g - the user belongs to the
      GROUP which owns the file
  o - the user OWNS the file, but
      groups are differnt
  - - both owner and group are
      different

The third flag shows the special bits:

  C - CHRISTMAS tree - setuid, setgid
      and sticky bits are set
  B - BOTH setuid and setgid are set
  S - SETUID and sticky are set
  G - SETGID and sticky are set
  s - SETUID is set
  g - SETGID is set
  t - STICKY is set
  - - no special flags are set

The last 3 flags show who can read,
write and execute the file 
respectively. These 3 flags are
combinations of the normal  ls 
flags (rwxrwxrwx). Each of the 
flags can take the following
values:

  a - anybody (owner, group, others)
  b - both    (owner, group)
  q - quirky  (owner, others)
  e - except  (group, others)
  o - owner   (owner)
  g - group   (group)
  n - neither (others)
  - - nobody at all ()      

For most file you should only
have to remember a, b and o.

If these letters are capitalized, 
then the current user may perform
the operation (read, write and
execute respectively).

The next field displays the
modification date of the file.
If the file has been modified within
the last hour, then the time in
<minutes.seconds> ELAPSED SINCE 
the file has been changed. For
older files changed today, the
modification TIME is given as
<hour.minute>. For files modified
this month, the modification date
is given as <weekday><monthday>, while
for even older files, the date is
given as <monthday><month>.
Files from last year or older
have a simple date field of the form
<year>.

EXAMPLE 

 -b-ABA 03.29   13k sls
 -b-AB- 03.32   11k sls.c

The executable  sls  was modified 
3 minutes and 29 seconds ago, I 
am (b)BOTH the owner and group owner
of the file. ABA means that
(A)ANYBODY can read the file, 
(B)BOTH the owner and group can 
write the file and (A)ANYBODY can 
execute the file. The file 
sls.c is (-)not executable. In 
most cases it is sufficient to
remember that uppercase means the
right applies to me.
 
LICENSE

This program may only be used in
accordance with the terms set out
in the GNU Public License as published
by the Free Software Foundation.

UP FOR ADOPTION

I am happy with the program as 
it is (warts and all), and won't
be putting any more work into it. 
But you are more than welcome to pick
it up.
