For each operand that names a file of a type other than
directory, ls(1) displays its name as well as any requested,
associated information. For each operand that names a file of type
directory, ls(1) displays the names of files contained
within that directory, as well as any requested, associated
information.
If no operands are given, the contents of the current directory
are displayed. If more than one operand is given, non-directory
operands are displayed first; directory and non-directory operands
are sorted separately and in lexicographical order.
The following options are available:
-A
List all entries except for '.' and '..' .
-a
Include directory entries whose names begin with a dot
(.).
-b
Print unprintable filename characters in octal format (like
\001).
-C
Force multi-column output; this is the default when output is
to a terminal.
-c
Use time when file status was last changed for sorting or
printing.
-d
Directories are listed as plain files (not searched
recursively), and symbolic links in the argument list are not
indirected through.
-D
Adds the domain name before user and group names whenever they
are displayed.
-F
Display a forward slash (/) immediately after each path
name that is a directory, an asterisk (*) after each that is
executable, an at sign (@) after each symbolic link, and a
vertical bar (|) after each that is a first in-first out
(FIFO).
-f
Output is not sorted.
-g
List in long format (as for -l), but do not print the
owner.
-i
For each file, print the file's serial number.
-k
Display file sizes in units of 1024 bytes (1K). Only relevant
when -s is also specified. Supercedes any value in the
BLOCKSIZE environment variable.
-L
If the file is a symbolic link, list the file referenced
by the link rather than the link itself.
-l
(The lowercase letter "l.") List in long format. If the output
is to a terminal, a total sum for all the file sizes is output on a
line before the long listing.
-m
List in stream output format so that files are listed across
the page and separated by commas.
-n
List in long format (as for -l), but print the user
identifier (ID) and group ID numbers instead of the user and group
names.
-o
List in long format (as for -l), but do not print the
group.
-p
Indicate a directory by putting a forward slash (/)
after the name.
-q
Force printing of non-graphic characters in file names as the
question-mark character (?); this is the default when output
is to a terminal.
-R
Recursively list subdirectories encountered.
-r
Reverse the order of the sort to get reverse lexicographical
order or the oldest entries first.
-s
Display the number of file system blocks actually used by each
file, in units of 512 bytes, where partial units are rounded up to
the next integer value. A total sum for all the file sizes is
output on a line before the listing.
-t
Sort by time modified (most recently modified first) before
sorting the operands by lexicographical order.
-T
Display complete time information about files regardless of
their age. The time information is in the format:
Tue Feb 2 14:55:42 EST 1997
dow mon day hh:mm:ss TZ yyyy
dow
Abbreviated day of the week.
mon
Abbreviated month.
hh:mm:ss
Time of day.
TZ
Time zone.
yyyy
Year expressed as four digits.
-u
Use time of last access instead of last modification of the
file for sorting (-t) or printing (-l).
-1
(The numeric digit "one.") Force output to be one entry per
line. This is the default when output is not to a terminal.
The -1, -C, and -l options all override
each other; the last one specified determines the format used.
The -c, and -u options override each other; the
last one specified determines the file time used.
By default, ls(1) lists one entry per line to standard
output; the exceptions are to terminals or when the -C
option is specified.
File information is displayed with one or more occurrences of
<blank> separating the information associated with the
-i, -s, and -l options.
If the -l option is given, the following information is
displayed for each file: file mode, number of links, owner name,
group name, number of bytes in the file, date file was last
modified (if the file was modified in the last six months, it is in
the format abbreviated month, day-of-month, hour, minute; if the
file has not been modified for more than six months or has a date
in the future, the date is in the format abbreviated month,
day-of-month, year), and the path name. In addition, for each
directory whose contents are displayed, the total number of
512-byte blocks used by the files in the directory is displayed on
a line by itself immediately before the information for the files
in the directory.
If the owner or group names are not a known user or group name,
the numeric IDs are displayed.
If the file is a character-special or block-special file, the
major and minor device numbers for the file are displayed in the
size field. If the file is a symbolic link, the path name of the
linked-to file is preceded by ->.
The file mode printed under the -l option consists of the
entry type, owner permissions, and group permissions. The
entry-type character describes the type of file, as follows:
b
Block-special file.
c
Character-special file.
d
Directory.
l
Symbolic link.
p
FIFO or a Windows system file.
s
Socket link.
-
Regular file.
The next three fields are three characters each: owner
permissions, group permissions, and other permissions. Each field
has three character positions:
If r, the file is readable; if -, it is not
readable.
If w, the file is writeable; if -, it is not
writeable.
The first of the following that applies:
S
If in the owner permissions, the file is not executable and
set-user-ID mode is set. If in the group permissions, the file is
not executable and set-group-ID mode is set.
s
If in the owner permissions, the file is executable and
set-user-ID mode is set. If in the group permissions, the file is
executable and set-group-ID mode is set.
t
The 01000 (octal) bit, or sticky bit, is set (see chmod(1)), and
the execute bit is on.
T
The 01000 bit is set, and the execute bit is clear. This state
is undefined.
x
The file is executable or the directory is searchable.
-
The file is not readable, writeable, executable, set-user-ID,
or set-group-ID mode.
As an extension, the Interix version of ls(1) can also
print a plus character (+) after the permissions string.
This indicates that the file has additional entries on its
discretionary access control list that cannot be represented in the
traditional format. You must use a Windows tool (such as File
Manager or CACLS.EXE) to display these entries.
The following environment variables affect the execution of
ls(1):
BLOCKSIZE
If the environment variable BLOCKSIZE is set, the block
counts (see -s) will be displayed in units of that size
block.
COLUMNS
If this variable contains a string representing a decimal
integer, it is used as the column position width for displaying
multiple-text-column output. The ls(1) utility calculates
how many path name text columns to display based on the width
provided.