HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)
l
ls(1) ls(1)
Access Control Lists (ACLs)
If a file has optional ACL entries, the
-l (ell) option displays a plus sign (+) after the file’s permissions.
The permissions shown are a summary representation of the file’s access control list, as returned by
stat() in the st_mode field (see stat(2)). To list the contents of an access control list, use the
lsacl
command (see lsacl(1) and acl(5)) for HFS file systems, or the
getacl command (see getacl(1) and aclv(5))
for JFS file systems.
EXTERNAL INFLUENCES
For information about the UNIX standard environment, see standards(5).
Environment Variables
If the
COLUMNS variable is set, ls uses the width provided in determining positioning of columnar output.
LANG determines the locale to use for the locale categories when both
LC_ALL and the corresponding
environment variable (beginning with
LC_) do not specify a locale. If
LANG is not set or is null, it defaults
to
C (see lang(5)).
LC_COLLATE determines the order in which the output is sorted.
LC_CTYPE determines which characters are classified as nonprinting for the -b and -q
options, and the
interpretation of single- and/or multibyte characters within file names.
LC_TIME determines the date and time strings output by the -g, -l (ell), -n
, and -o options.
LC_MESSAGES determines the language in which messages (other than the date and time strings) are
displayed.
If any internationalization variable contains an invalid setting, they all default to
C (see environ(5)).
International Code Set Support
Single- and multibyte character code sets are supported.
RETURN VALUE
ls exits with one of the following values:
0 All input files were listed successfully.
>0 ls was aborted because errors occurred when accessing files. The following conditions cause an
error:
• Specified file not found.
• User has no permission to read the directory.
• Process could not get enough memory.
• Invalid option specified.
EXAMPLES
Print a long listing of all the files in the current working directory (including the file sizes). List the most
recently modified (youngest) file first, followed by the next older file, and so forth, to the oldest. Files
whose names begin with a . are also printed.
ls -alst
WARNINGS
Setting options based on whether the output is a login (tty) device is undesirable because ls -s is very
different from ls-s|lp. On the other hand, not using this setting makes old shell scripts that used ls
almost inevitably fail.
Nonprinting characters in file names (without the -b or -q option) may cause columnar output to be
misaligned.
DEPENDENCIES
NFS
The -l (ell) option does not display a plus sign (+) after the access permission bits of networked files to
represent existence of optional access control list entries.
AUTHOR
ls was developed by AT&T, the University of California, Berkeley and HP.
HP-UX 11i Version 3: February 2007 − 4 − Hewlett-Packard Company 609