HP-UX Reference (11i v2 04/09) - 1 User Commands A-M (vol 1)

l
ls(1) ls(1)
size field contains the major and minor device numbers rather than a size. If the file is a sym-
bolic link, the filename is printed, followed by
-> and the pathname of the referenced file.
-m Stream output format.
-n The same as -l, (ell) except that the owner’s UID and group’s GID numbers are printed,
rather than the associated character strings.
-o The same as -l, (ell) except that only the owner is printed (group is omitted). (If both
-l (ell)
and
-o are specified, the group is not printed).
-p Put a slash (
/) after each file name if that file is a directory.
-q List nonprinting characters in file names as the character (
?).
-r Reverse the order of sort to get reverse (descending) collation or oldest first, as appropriate.
-s List size in blocks, including indirect blocks, for each entry. The first entry listed is the total
number of blocks in the directory. When used in multicolumn output, the number of blocks
precedes the file name in each column. The number of indirect blocks in a file is filesystem
dependent.
-t Sort by time modified (latest first) before sorting alphabetically.
-u Use time of last access instead of last modification for sorting (
-t option) or printing (-l (ell)
option).
-x List multicolumn output with entries sorted across rather than down the page.
-A The same as -a, except that the current directory . and parent directory
.. are not listed.
For a user with appropriate privileges, this flag defaults to on, and is turned off by
-A.
-C List multicolumn output with entries sorted down the columns.
-F After each file name, put one of:
A slash (
/) if the file is a directory or a symbolic link to a directory.
An asterisk (*) if the file is executable;
An at-sign (@) if the file is a symbolic link to a file;
A vertical bar (|) if the file is a fifo.
-L Evaluate the file information and file type for all symbolic links (whether named on the com-
mand line or encountered in a file hierarchy) to be those of the file referenced by the link, and
not the link itself. However, ls shall write the name of the link itself and not the file refer-
enced by the link. When -L is used with -l, write the contents of symbolic links in the long
format.
-R Recursively list subdirectories encountered.
-1 (one) List the file names in single column format regardless of the output device. This forces
single column format to the user’s terminal.
Specifying more than one of the options in the following mutually exclusive pairs is not considered an
error:
-C and -l (ell), -m and -l (ell), -x and -l (ell), -C and -1 (one), and -c and -u.
ls is known by several shorthand-version names for the various formats:
l is equivalent to ls -m
ll is equivalent to ls -l (ell)
lsf is equivalent to ls -F
lsr is equivalent to ls -R
lsx is equivalent to ls -x
The shorthand notations are implemented as links to ls. Option arguments to the shorthand versions
behave exactly as if the long form above had been used with the additional arguments.
Mode Bits Interpretation (-l option)
The mode printed in listings produced by the
-l (ell) option consists of 10 characters, for example,
-rwxr-xr-x.
The first character indicates the entry type:
b Block special file
HP-UX 11i Version 2: September 2004 2 Hewlett-Packard Company Section 1535