ls(1) MPE/iX Shell and Utilities ls(1)
______________________________________________________________________
NAME
ls -- list file and directory names and attributes
SYNOPSIS
ls [-AabCcdFfgiLlmnopqRrstux1] [pathname ...]
DESCRIPTION
Note: The MPE/iX implementation of this utility does not function
exactly as this man page describes. For details, see the MPE/iX
NOTES section at the end of this man page.
ls lists files and directories. If the pathname is a file, ls
displays information on the file according to the requested
options. If it is a directory, ls displays information on the
files and subdirectories therein. You may obtain information on
a directory itself using the -d option.
If you do not specify any options, ls displays only the file
name(s). When ls sends output to a pipe or a file, it writes one
name per line; when it sends output to the terminal, it uses the
-C (multi-column) format.
Options
ls accepts the following options:
-A lists all entries including those starting with periods (.);
but excluding any . or .. entries.
-a lists all entries including those starting with a period (-
.).
-b displays non-printable characters in octal, as \ooo.
-C puts output into columns, sorted vertically; this is the
default output format to the terminal.
-c uses the time of the last modification of the file's attri-
butes for sorting (-t) or displaying (-l).
-d does not display the contents of named directories, but
information on the directories themselves.
-F puts a / after each directory name, a * after every execut-
able file, a | after every FIFO file, a @ after every sym-
bolic link, and a = after every socket.
-f enables the -a option and disables the -C option. This means
that for each argument that is a directory, all directory
entries are listed in the same order they are retrieved from
the system.
-g displays only the group ID numbers.
1
ls(1) MPE/iX Shell and Utilities ls(1)
______________________________________________________________________
-i displays inode numbers along with file names.
-L follows symbolic links (only on systems that support sym-
bolic links).
-l displays permissions, links, owner, group, size, time, name;
see Long Output Format.
-m displays names in single line, with commas separating names.
-n displays user ID and group ID numbers.
-o displays only the user ID of owner.
-p puts / after directory names.
-q displays non-printable characters as ?.
-R lists subdirectories recursively.
-r sorts in reverse of usual order; you can combine this with
other options that sort the list.
-s displays size in blocks (after the inode number, but before
other information).
-t sorts by time. By default, this option sorts the output by
the modification times of files. You can change this with
the -c and -u options.
-u uses the last access time for sorting (-t) or displaying (-
-l).
-x puts output into sorted columns, with output going across
the rows.
-1 forces output to be single column.
Note: When you specify options that are mutually exclusive (for
example, -c and -u), the option that appears last on the command
line is used.
Long Output Format
The output from ls -l summarizes all the most important informa-
tion about the file on one line. If the specified pathname is a
directory, ls displays information on every file in that direc-
tory (one file per line). It precedes this list with a status
line that indicates the total number of file system blocks (512
byte units) occupied by the files in that directory. Here is a
sample of the output along with an explanation.
-rw-rw-rw- 1 root dir 104 Dec 25 19:32 file
2
ls(1) MPE/iX Shell and Utilities ls(1)
______________________________________________________________________
The first character identifies the file type:
- regular file
b block special file
c character special file
d directory
l symbolic link
p FIFO
s socket
The next nine characters are in three groups of three; they
describe the permissions on the file. The first group of three
describes owner permissions; the second describes group permis-
sions; the third describes other (or world) permissions. Charac-
ters that may appear are:
r Permission to read file
w Permission to write on file
x Permission to execute file
The following characters only appear in the execute permission
(x) position of the output.
S Same as s except execute is turned off
s If in owner permissions section, setuid bit is on;
if in group permissions section, setgid bit is on
T Same as t except execute bit is turned off
t Save text bit is on
You can set some permissions with the chmod(1) command.
After the permissions comes the number of links to the file.
Next comes the name of the owner of the file or directory.
Then comes the name of the group that owns the file or directory.
Following this is the size of the file, expressed in bytes.
After this comes a date and time. For a file, this is the time
that the file was last changed; for a directory, it is the time
that the directory was created. The -c and -u options can change
which time value is used.
The last item on the line is the name of the file or directory.
ENVIRONMENT VARIABLES
ls uses the following environment variables:
3
ls(1) MPE/iX Shell and Utilities ls(1)
______________________________________________________________________
COLUMNS
contains the terminal width in columns. ls uses this value
to determine the number of output columns to write using the
-C option.
TZ
contains the time zone to be used when displaying date and
time strings.
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 Failure due to any of the following:
-- out of memory
-- inability to find a file's information
-- too many directories
-- file/directory not found
2 Failure due to an invalid command line option.
Messages
Message: cannot allocate memory for sorting
Cause: There were not enough system resources available for ls
to sort its output.
Action: Free up more system resources or use option and path
names on the command that will produce less output.
Message: File or directory "pathname" is not found
Cause: You specified a pathname that does not exist.
Action: Check to make sure that you did not omit or misspell
any components of pathname.
Message: insufficient memory
Cause: There were not enough free system resources to perform
the specified operation.
Action: Free up more resources.
Message: strcoll error, cannot malloc space.
Cause: There are not enough free system resources to allocate
string space.
Action: Free up more resources.
Message: pathname: system error
Cause: See syserror(3).
Action: See syserror(3).
Message: too many directory entries in "pathname"
Cause: This message only appears when ls runs out of dynami-
cally allocated system resources.
Action: Free up more system resources.
4
ls(1) MPE/iX Shell and Utilities ls(1)
______________________________________________________________________
Message: Unknown option "-option"
Cause: You specified an option that is not valid for ls.
Action: Check the DESCRIPTION section for a list of valid ls
options.
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems.
The -A, -b, -f, -g, -L, -m, -n, -o, -p, -s, and -x options are
extensions to the POSIX standard.
MPE/iX NOTES
On the current MPE/iX implementation, the inode number is
MPE/iX's unique 32-bit mapping of the file's 48-bit UFID. Also,
on MPE/iX, the user and group fields are 17 characters long and 8
characters long, respectively.
You may notice that for certain files, the current MPE/iX imple-
mentation of ls shows the date that the file's attributes were
last modified to be January 1, 1970. The reason for this is that
MPE/iX Release 4.5 added a new field, state_chg_time to file
labels. This field indicates the time that the file's attributes
were modified. When a system is updated to MPE/iX Release 4.5 or
later, all files labels are updated to the new data structure;
however for files created using MPE/iX releases before 4.5, the
system cannot determine what data to put in the state_chg_time
field and instead, sets the field to zero. ls interprets the
value zero as January 1, 1970, which is the zero date for all HP
3000 systems. As soon as the file's attributes are modified
after the update, the state_chg_time field is set to the correct
date.
On MPE/iX, ls is available as both a built-in shell utility and
an external utility.
For more information on how the current MPE/iX implementation may
affect the operation of this utility, see Appendix A, MPE/iX
Implementation Considerations.
SEE ALSO
chmod(1), lc(1)
5