LS(1)

NAME
ls - list the contents of a directory

SYNOPSIS
ls [-acdfgilqrstu1ACFLMRTX] [name...]

DESCRIPTION
For each file argument, list it. For each directory argument, list its contents. The current working directory is listed when no files are named. Information is printed multicolumn on terminals, single column if the output is redirected. The options control what information is shown and how.

Ls has two sources other then the commands line to draw options from, one is the environment variable LSOPTS and is used only when the output of ls is displayed on a terminal. The other is the name of ls itself. If ls is linked to another name, then all the characters after the l are used as flags too, except that f, r, t and x are translated to F, R, T and X. Useful links are ll, lf, lm and lx.

Files whose names start with a dot are by default not listed.

Note that standard Minix doesn't have symbolic links or sockets and -u and -c are no-ops on a V1 file system, since only modified times are stored in V1 inodes.

OPTIONS

-a  All entries are listed, even . and ..

-c  Use inode changed time for sorting, listing or searching.

-d  Do not list contents of directories, but list the directory itself.

-f  Do not sort (should also be: treat a file as a directory, but that can't be implemented portably).

-g  Suppress the owner name on a long listing (implies -l).

-i  I-node number printed in first column.

-l  Long listing: mode, links, owner, group, size and time. (ls -lC uses columns in a wide enough window!)

-n  Print numerical user and group id's.

-q  Print nongraphic characters as '?' (default on terminals).

-r  Reverse the sort order.

-s  Give size in kilobytes.

-t  Sort by time (modified time default), latest first.

-u  Use last accessed time for sorting, listing or searching.

-1  Print in one column.

-A  List all entries, but not . and .. (This is the default for privileged users.)

-C  Print multicolumn (default on terminals).

-F  Mark directories with a '/', executables with a '*', UNIX domain sockets with a '=' and symbolic links with a '@' behind the name.

-L  Print the file referenced by a symbolic link instead of the link.

-M  List mode before name (implies -C).

-R  List directory trees recursively.

-T  Group files by type, i.e. regular files together, directories together, etc.

-X  Print crunched mode and size before name (implies -C). Only the rwx permissions that its caller has on the file, but they are in upper case if the caller owns the file and has given the permission to the callers group or other users. The size is listed in bytes (<= 5K), or rounded up kilo, mega or gigabytes.

SEE ALSO
du(1), stat(1), stat(2).

BUGS
Having to type ls -C when viewing files through more(1).

Is only portable to systems with the same st_mode (see stat(2)).

The LSOPTS variable and the -M, -T and -X flags are not found on other ls implementations. (They have there own nonstandard flags.)

AUTHOR
Kees J. Bot (kjb@cs.vu.nl)