📄 0303-0304.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:User Commands:EarthWeb Inc.-</TITLE>
</HEAD>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=01 //-->
<!-- PAGES=0001-0736 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0301-0302.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0305-0307.html">Next</A></CENTER></P>
<A NAME="PAGENUM-303"><P>Page 303</P></A>
<H3><A NAME="ch01_ 153">
ls, dir, vdir
</A></H3>
<P>s, dir, vdir—List contents of directories
</P>
<P><B>SYNOPSIS</B></P>
<!-- CODE //-->
<PRE>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...]
</PRE>
<!-- END CODE //-->
<P><B>DESCRIPTION</B></P>
<P>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.
</P>
<P><B>OPTIONS</B></P>
<TABLE>
<TR><TD>
_a, --all
</TD><TD>
List all FILES in directories, including all FILES that start with a period
(.).
</TD></TR><TR><TD>
_b, --escape
</TD><TD>
Quote nongraphic characters in filenames using alphabetic and octal backslash
sequences like those used in C.
</TD></TR><TR><TD>
_c, --time=ctime,
</TD><TD>
Sort directory contents according to the FILES' status change time instead of the modification
</TD></TR><TR><TD>
--time=status
</TD><TD>
time. If the long listing format is being used, print the status change time instead of
the modification time.
</TD></TR><TR><TD>
_d, --directory
</TD><TD>
List directories like other FILES, rather than listing their contents.
</TD></TR><TR><TD>
_f
</TD><TD>
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.
</TD></TR><TR><TD>
--full-time
</TD><TD>
List times in full, rather than using the standard abbreviation heuristics.
</TD></TR><TR><TD>
_g
</TD><TD>
Ignored; for UNIX compatibility.
</TD></TR><TR><TD>
_i, --inode
</TD><TD>
Print the index number of each file to the left of the filename.
</TD></TR><TR><TD>
_k, --kilobytes
</TD><TD>
If file sizes are being listed, print them in kilobytes. This overrides the ENVIRONMENT
variable POSIXLY_CORRECT.
</TD></TR><TR><TD>
_l, --format=long,
</TD><TD>
In addition to the name of each file, print the file type, permissions, number of hard links,
</TD></TR><TR><TD>
--format=verbose
</TD><TD>
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.
</TD></TR><TR><TD>
_m, --format=commas
</TD><TD>
List FILES horizontally, with as many as will fit on each line, separated by commas.
</TD></TR><TR><TD>
_n, --numeric-uid-gid
</TD><TD>
List the numeric UID and GID instead of the names.>
</TD></TR><TR><TD>
_p
</TD><TD>
Append a character to each filename indicating the file type.
</TD></TR><TR><TD>
_q, --hide-control-chars
</TD><TD>
Print question marks instead of nongraphic characters in filenames.
</TD></TR><TR><TD>
_r, --reverse
</TD><TD>
Sort directory contents in reverse order.
</TD><TR><TR><TD>
_s, --size
</TD><TD>
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.
</TD><TR><TR><TD>
_t, --sort=time
</TD><TD>
Sort directory contents by timestamp instead of alphabetically, with the newest FILES
listed first.
</TD><TR><TR><TD>
_u, --time=atime,
--time=access,--time=use
</TD><TD>
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.
</TD></TR></TABLE>
<A NAME="PAGENUM-304"><P>Page 304</P></A>
<TABLE>
<TR><TD>
_x, --format=across,
</TD><TD>
List the FILES in columns, sorted horizontally.
</TD></TR><TR><TD>
--format=horizontal
</TD><TD>
</TD></TR><TR><TD>
_A, --almost-all
</TD><TD>
List all FILES in directories, except for
`.' and `..'.
</TD></TR><TR><TD>
_B, --ignore-backups
</TD><TD>
Do not list FILES that end with
~, unless they are given on the command line.
</TD></TR><TR><TD>
_C, --format=vertical
</TD><TD>
List FILES in columns, sorted vertically.
</TD></TR><TR><TD>
_F, --classify
</TD><TD>
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.
</TD></TR><TR><TD>
_G, --no_group
</TD><TD>
Inhibit display of group information in a long format directory listing.
</TD><TR><TR><TD>
_L, --dereference
</TD><TD>
List the FILES linked to by symbolic links instead of listing the contents of the links.
</TD><TR><TR><TD>
_N, --literal
</TD><TD>
Do not quote filenames.
</TD><TR><TR><TD>
_Q, --quote-name
</TD><TD>
Enclose filenames in double quotes and quote nongraphic characters as in C.
</TD><TR><TR><TD>
_R, --recursive
</TD><TD>
List the contents of all directories recursively.
</TD><TR><TR><TD>
_S, --sort=size
</TD><TD>
Sort directory contents by file size instead of alphabetically, with the largest FILES listed first.
</TD><TR><TR><TD>
_U, --sort=none
</TD><TD>
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.
</TD><TR><TR><TD>
_X, --sort=extension
</TD><TD>
Sort directory contents alphabetically by file extension (characters after the last period);
FILES with no extension are sorted first.
</TD><TR><TR><TD>
_1, --format=single-column
</TD><TD>
List one file per line.
</TD><TR><TR><TD>
_w, --width cols
</TD><TD>
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.
</TD><TR><TR><TD>
_T, --tabsize cols
</TD><TD>
Assume that each tab stop is
cols columns wide. The default is 8.
</TD><TR><TR><TD>
_I, --ignore pattern
</TD><TD>
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.
</TD><TR><TR><TD>
--help
</TD><TD>
Print a usage message on standard output and exit successfully.
</TD><TR><TR><TD>
--version
</TD><TD>
Print version information on standard output then exit successfully.
</TD></TR></TABLE>
<P><B>BUGS</B></P>
<P>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.
</P>
<P>GNU File Utilities
</P>
<P><B>lsattr</B></P>
<P>lsattr—List file attributes on a Linux second extended FILESystem
</P>
<P><B>SYNOPSIS</B></P>
<!-- CODE SNIP //-->
<PRE>lsattr [ _Radv ] [ FILES... ]
</PRE>
<!-- END CODE SNIP //-->
<P><B>DESCRIPTION</B></P>
<P>lsattr lists the FILES attributes on an second extended FILESystem.
</P>
<P><CENTER>
<a href="0301-0302.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0305-0307.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -