NAME
ls, lc, l, ll, lsf, lsr, lsx - list contents of directories
SYNOPSIS
ls [-abcdefgilmnopqrstuxACFLR1] [names]
lc [-abcdefgilmnopqrstuxACFLR1] [names]
l[ls_options] [names] ll [ls_options] [names] lsf [ls_options] [names] lsr [ls_options] [names] lsx [ls_options] [names]
DESCRIPTION
For each directory argument, the ls command lists the contents of the directory. For each ®le argument, ls repeats its name and any other information requested. The output is sorted in ascending collation order by default (see Environment Variables below). When no argument is given, the current directory is listed. When several arguments are given, the arguments are ®rst sorted appropriately, but ®le arguments appear before directories and their contents.
If you are a user with appropriate privileges, all ®les except . and .. are listed by default.
There are three major listing formats. The format chosen depends on whether the output is going to a login device (determined by whether output device ®le is a tty device), and can also be controlled by option ¯ags. The default format for a login device is to list the contents of directories in multicolumn format, with entries sorted vertically by column. (When individual ®le names (as opposed to directory names) appear in the argument list, those ®le names are always sorted across the page rather than down the page in columns because individual ®le names can be arbitrarily long.) If the standard output is not a login device, the default format is to list one entry per line. The -Cand -xoptions enable multicolumn formats, and the -moption enables stream output format in which ®les are listed across the page, separated by commas. In order to determine output formats for the -C, -x, and -moptions, ls uses an environment variable, COLUMNS, to determine the number of character positions available on each output line. If this variable is not set, the terminfo database is used to determine the number of columns, based on the environment variable TERM. If this information cannot be obtained, 80 columns is assumed.
The command lc functions the same as ls except that the lc default output is columnar, even if output is redirected.
Options
ls recognizes the following options:
-aList all entries; usually entries whose names begin with a period (.) are not listed. -bList nonprinting characters in the octal \ddd notation.
-cUse time of last modi®cation of the inode (®le created, mode changed, etc.) for sorting (-t) or printing (-l(ell)).
-dIf an argument is a directory, list only its name (not its contents); often used with -l(ell) to get the status of a directory.
-eList the extent attributes of the ®le. If any of the ®les has a extent attribute, this option lists the extent size, space reserved and allocation ¯ags. This option must be used with the -l(ell) option.
-fInterpret each argument as a directory and list the name found in each slot. This option disables -l(ell), -r, -s, and -t, and enables -a; the order is the order in which entries appear in the directory.
-gSame as -l(ell), except that only the group is printed (owner is omitted). If both -l(ell) and -gare speci®ed, the owner is not printed.
-iFor each ®le, list the inode number in the ®rst column of the report. When used in multicolumn output, the number precedes the ®le name in each column.
-l(ell) List in long format, giving mode, number of links, owner, group, size in bytes, and time of last modi®cation for each ®le (see further DESCRIPTION and Access Control Lists below). If the time of last modi®cation is greater than six months ago, or any time in the future, the year is
Section 1−480 | − 1 − | HP-UX Release 11i: December 2000 |