LC(C) XENIX System V LC(C)
Name
lc - Lists directory contents in columns.
Syntax
lc [ -1ACFRabcdfgilmnopqrstux ] name ...
Description
lc lists the contents of files and directories, in columns.
If name is a directory name, lc lists the contents of the
directory; if name is a filename, lc repeats the filename
and any other information requested. Output is given in
columns and sorted alphabetically. If no argument is given,
the current directory is listed. If several arguments are
given, they are sorted alphabetically, but file arguments
appear before directories.
Files that are not the contents of a directory being
interpreted are always sorted across the page rather than
down the page in columns. A stream output format is
available in which files are listed across the page,
separated by commas. The -m option enables this format.
The options are:
-1 Forces an output format with one entry per line.
-A If not the root directory, this option displays all
files that begin with ``.'' (except ``.'' and ``..''
themselves). Otherwise, files are displayed normally.
-C Forces columnar output, even if redirected to a file.
-F Causes directories to be marked with a trailing ``/''
and executable files to be marked with a trailing
``*''.
-R Recursively lists subdirectories.
-a Lists all entries; ``.'' and ``..'' are not suppressed.
-b Forces printing of nongraphic characters in the \ddd
notation, in octal.
-c Sorts by time of file creation.
-d If the argument is a directory, lists only its name,
not its contents (mostly used with -l to get status on
directory).
-f Forces each argument to be interpreted as a directory
and lists the name found in each slot. This option
turns off -l, -t, -s, and -r, and turns on -a; the
Page 1 (printed 8/7/87)
LC(C) XENIX System V LC(C)
order is the order in which entries appear in the
directory.
-g The same as -l, except that the owner is not printed.
-i Prints inode number in first column of the report for
each file listed.
-l Lists in long format, giving mode, number of links,
owner, group, size in bytes, and time of last
modification for each file. If the file is a special
file, the size field instead contains the major and
minor device numbers.
-m Forces stream output format.
-n Same as the -l switch, but the owner's user ID appears
instead of the owner's name. If used in conjunction
with the -g switch, the owner's group ID appears
instead of the group name.
-o The same as -l, except that the group is not printed.
-p Pad output with spaces.
-q Forces printing of nongraphic characters in filenames
as the character ``?''.
-r Reverses the order of sort to get reverse alphabetic or
oldest first as appropriate.
-s Gives size in 512-byte blocks, including indirect
blocks for each entry.
-t Sorts by time modified (latest first) instead of by
name, as is normal.
-u Uses time of last access instead of last modification
for sorting (-t) or printing (-l).
-x Forces columnar printing to be sorted across rather
than down the page.
The following are alternate invocations of the lc command:
lf Produces the same output as lc-F.
lr Produces the same output as lc-R.
lx Produces the same output as lc-x.
The mode printed under the -l option contains 11 characters.
Page 2 (printed 8/7/87)
LC(C) XENIX System V LC(C)
The first character is:
- If the entry is a plain file
d If the entry is a directory
b If the entry is a block-type special file
c If the entry is a character-type special file
p If the entry is a named pipe
s If the entry is a semaphore
m If the entry is shared data (memory)
The next 9 characters are interpreted as 3 sets of 3 bits
each. The first set refers to owner permissions; the next
to permissions to others in the same user-group; and the
last to all others. Within each set, the 3 characters
indicate permission respectively to read, to write, or to
execute the file as a program. For a directory, ``execute''
permission is interpreted to mean permission to search the
directory for a specified file. The permissions are
indicated as follows:
r If the file is readable
w If the file is writable
x If the file is executable
- If the indicated permission is not granted
The group-execute permission character is given as s if the
file has set-group-ID mode; likewise the user-execute
permission character is given as s if the file has set-
user-ID mode.
The last character of the mode (normally ``x'' or ``-'') is
t if the 1000 bit of the mode is on. See chmod(C) for the
meaning of this mode.
When the sizes of the files in a directory are listed, a
total count of blocks, including indirect blocks, is
displayed.
Files
/etc/passwd To get user IDs for ``lc -o''
/etc/group To get group IDs for ``lc -g''
Page 3 (printed 8/7/87)
LC(C) XENIX System V LC(C)
Credit
This utility was developed at the University of California
at Berkeley and is used with permission.
Notes
Newline and tab are considered printing characters in
filenames. The output device is assumed to be 80 columns
wide. Column width choices are poor for terminals that can
tab.
This utility reports sizes in 512 byte blocks. On systems
which use 1024 byte blocks, this means a file of 500 bytes
uses 2 blocks. lc-s will report 2 blocks used, rather than
1 block, since the file uses one system block of 1024 bytes.
Refer to the machine(M) manual page for the block size used
by your system.
Page 4 (printed 8/7/87)