PROPHET/OS

NAME

ls: shows what is in a directory

SYNOPSIS

ls [-l] [-h] [-a] [-s name|size|type|none] [-r] [-O name,rights,size,sums,type] [--mime] [--checksum[=...]] [path...]

DESCRIPTION

Shows what is in a directory. Without a path it shows the working directory; a path to a file shows that file alone, as its directory's line of it. Without -l only the names, side by side in columns as wide as the console, read down each column. Each name stands after the icon of its kind and in its colour; the kind is read from the file's first bytes (file, libprophet_mime), never from its name, and a file named urlaub.png that is a program shows a program's icon. On the serial line the icons are letters: d directory, t text, x program, l library, i image, a audio, v video, z archive, p document, s script, b data.

-l   the list: one entry per line, with rights, name and size
-h   sizes as KiB, MiB, GiB instead of bytes
-a   also the entries whose name begins with a dot
-s name|size|type|none
     sorted by name (the default), by size, by kind (its MIME
     type), each tie by name; none keeps the disk's order
-r   the sort turned round
-O name,rights,size,sums,type   (or --order=...)
     the list with its columns in that order; rights,name,size
     when none is named (ls.conf: order)
--mime
     the list, and each kind's MIME type right of the name
--checksum=crc32,md5,sha256
     the list, and each file's digests right of its name, one column each; the
     methods are those of `checksum` (crc32, crc32c, md5, sha1,
     sha256, sha384, sha512, sha3, fletcher, blake3, edonr, skein,
     blake2b), sha256 when none is named; a directory shows `-`,
     a file that cannot be read `?`

Settings in ls.conf (<home>/.ls.conf before /system/config/ls.conf): icons on|off, colours on|off, mime on|off, order rights,name,size. Kinds, their names, icons and colours stand in lib/mime/mime.yaml.

Every column stands straight: a first pass measures the longest size and, with digests, the longest name.

-h is the human readable size and nothing else. The single letter is not help: a flag that means something different in every program is a flag the frame may not take for itself, so help is --help or -?, everywhere.

Rights are shown as the file system keeps them, octal, and set with pfs mode.

EXAMPLE

$ ls -l /system
  Rights        Name        Size
  drwxrwxr-x  d bin            -
  drwxrwxr-x  d config         -
  drwxrwxr-x  d firmware       -
  drwxrwxr-x  d kernels        -
  -rwxrwxr-x  b ksym      135114
  -rwxrwxr-x  b ksym.all  246795
  drwxrwxr-x  d lib            -
  drwxrwxr-x  d man            -
  drwxrwxr-x  d modules        -
  drwxrwxr-x  d packages       -
  drwxrwxr-x  d pgl            -
  drwxrwxr-x  d sbin           -
  drwxrwxr-x  d settings       -
  drwxrwxr-x  d shared         -
  drwxrwxr-x  d themes         -
  drwxrwxr-x  d trust          -

  16 entries, 381909 bytes in files

SEE ALSO

find, cat, pfs, mounts