-->

Previous | Table of Contents | Next

Page 303

ls, dir, vdir

s, dir, vdir—List contents of directories

SYNOPSIS

ls [_abcdfgiklmnpqrstuxABCFGLNQRSUX1] [_w cols] [_T cols] [_I pattern] [--all]

[--escape] [--directory] [--inode] [--kilobytes] [--numeric-uid-gid] [_no-group]

[--hide-control-chars] [--reverse] [--size] [--width=cols] [--tabsize=cols]

[--almost-all] [--ignore-backups] [--classify] [--file-type] [--full-time]

[--ignore=pattern] [--dereference] [--literal] [--quote-name] [--recursive]

[-- -sort={none, time, size, extension}] [--format={long, verbose, commas,

across, vertical, single-column}] [--time={atime, access, use, ctime, status}]

[--help] [--version] [name...]

DESCRIPTION

This manual page documents the GNU version of ls. dir and vdir are versions of ls with different default output FORMATS. These programs list each given file or directory name. Directory contents are sorted alphabetically. For ls, FILES are by default listed in columns, sorted vertically, if the standard output is a terminal; otherwise, they are listed one per line. For dir, FILES are by default listed in columns, sorted vertically. For vdir, FILES are by default listed in long format.

OPTIONS

_a, --all List all FILES in directories, including all FILES that start with a period (.).
_b, --escape Quote nongraphic characters in filenames using alphabetic and octal backslash sequences like those used in C.
_c, --time=ctime, Sort directory contents according to the FILES' status change time instead of the modification
--time=status time. If the long listing format is being used, print the status change time instead of the modification time.
_d, --directory List directories like other FILES, rather than listing their contents.
_f Do not sort directory contents; list them in whatever order they are stored on the disk. This is the same as enabling _a and _U and disabling _l, _s, and _t.
--full-time List times in full, rather than using the standard abbreviation heuristics.
_g Ignored; for UNIX compatibility.
_i, --inode Print the index number of each file to the left of the filename.
_k, --kilobytes If file sizes are being listed, print them in kilobytes. This overrides the ENVIRONMENT variable POSIXLY_CORRECT.
_l, --format=long, In addition to the name of each file, print the file type, permissions, number of hard links,
--format=verbose owner name, group name, size in bytes, and timestamp (the modification time unless other times are selected). For FILES with a time that is more than six months old or more than one hour into the future, the timestamp contains the year instead of the time of day.
_m, --format=commas List FILES horizontally, with as many as will fit on each line, separated by commas.
_n, --numeric-uid-gid List the numeric UID and GID instead of the names.>
_p Append a character to each filename indicating the file type.
_q, --hide-control-chars Print question marks instead of nongraphic characters in filenames.
_r, --reverse Sort directory contents in reverse order.
_s, --size Print the size of each file in 1KB blocks to the left of the filename. If the ENVIRONMENT variable POSIXLY_CORRECT is set, 512-byte blocks are used instead.
_t, --sort=time Sort directory contents by timestamp instead of alphabetically, with the newest FILES listed first.
_u, --time=atime, --time=access,--time=use Sort directory contents according to the FILES' last access time instead of the modification time. If the long listing format is being used, print the last access time instead of the modification time.

Page 304

_x, --format=across, List the FILES in columns, sorted horizontally.
--format=horizontal
_A, --almost-all List all FILES in directories, except for `.' and `..'.
_B, --ignore-backups Do not list FILES that end with ~, unless they are given on the command line.
_C, --format=vertical List FILES in columns, sorted vertically.
_F, --classify Append a character to each filename indicating the file type. For regular FILES that are executable, append a *. The file type indicators are / for directories, @ for symbolic links, | for FIFOs, = for sockets, and nothing for regular FILES.
_G, --no_group Inhibit display of group information in a long format directory listing.
_L, --dereference List the FILES linked to by symbolic links instead of listing the contents of the links.
_N, --literal Do not quote filenames.
_Q, --quote-name Enclose filenames in double quotes and quote nongraphic characters as in C.
_R, --recursive List the contents of all directories recursively.
_S, --sort=size Sort directory contents by file size instead of alphabetically, with the largest FILES listed first.
_U, --sort=none Do not sort directory contents; list them in whatever order they are stored on the disk. This option is not called _f because the UNIX ls _f option also enables _a and disables _l, _s, and _t. It seems useless and ugly to group those unrelated things together in one option. Because this option doesn't do that, it has a different name.
_X, --sort=extension Sort directory contents alphabetically by file extension (characters after the last period); FILES with no extension are sorted first.
_1, --format=single-column List one file per line.
_w, --width cols Assume the screen is cols columns wide. The default is taken from the terminal driver if possible; otherwise, the ENVIRONMENT variable COLUMNS is used if it is set; otherwise, the default is 80.
_T, --tabsize cols Assume that each tab stop is cols columns wide. The default is 8.
_I, --ignore pattern Do not list FILES whose names match the shell pattern pattern unless they are given on the command line. As in the shell, an initial period (.) in a filename does not match a wildcard at the start of pattern.
--help Print a usage message on standard output and exit successfully.
--version Print version information on standard output then exit successfully.

BUGS

On BSD systems, the _s option reports sizes that are half the correct values for FILES that are NFS-mounted from HP-UX systems. On HP-UX systems, it reports sizes that are twice the correct values for FILES that are NFS-mounted from BSD systems. This is due to a flaw in HP-UX; it also affects the HP-UX ls program.

GNU File Utilities

lsattr

lsattr—List file attributes on a Linux second extended FILESystem

SYNOPSIS

lsattr [ _Radv ] [ FILES... ]

DESCRIPTION

lsattr lists the FILES attributes on an second extended FILESystem.

Previous | Table of Contents | Next