229-232.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 202 行

HTML
202
字号
<HTML>

<HEAD>

<TITLE>Linux in Plain English:Linux Commands Organized by Group</TITLE>

<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=1558285423//-->

<!--TITLE=Linux in Plain English//-->

<!--AUTHOR=Patrick Volkerding//-->

<!--AUTHOR=Kevin Reichard//-->

<!--PUBLISHER=IDG Books Worldwide, Inc.//-->

<!--IMPRINT=M & T Books//-->

<!--CHAPTER=5//-->

<!--PAGES=229-232//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="221-228.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="232-237.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P><FONT SIZE="+1"><B>dir......<TT>List Directory</TT></B></FONT></P>

<P><B>dir</B> <I>option(s) directory</I></P>

<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>

<P>The <B>dir</B> command lists the content of a directory. It&#146;s basically the same as the <B>Is</B> command, but it&#146;s included because MS-DOS uses <B>dir</B> and not <B>Is</B> to list directories.</P>

<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>

<TABLE WIDTH="100%">

<TR>

<TD WIDTH="20%"><B>-A</B>

<TD WIDTH="80%">Does not list. and&#133;

<TR>

<TD><B>-a</B>

<TD>Lists hidden files beginning with&#133;

<TR>

<TD><B>-B</B>

<TD>Ignores backup files, which begin with a tilde (~)

<TR>

<TD><B>-b</B>

<TD>Prints octal escapes for nongraphic characters.

<TR>

<TD><B>-C</B>

<TD>Lists enteries by columns.

<TR>

<TD VALIGN="TOP"><B>-c</B>

<TD>Sorts by change time; displays the change time when combined with <B>-1.</B>

<TR>

<TD><B>-D</B>

<TD>Generates output suited to the <B>emacs</B> <I>dired</I> mode.

<TR>

<TD><B>-d</B>

<TD>Lists directory enteries instead of contents.

<TR>

<TD><B>-e</B>

<TD>Lists both the date and the full time.

<TR>

<TD><B>-F</B>

<TD>Appends a character for typing each entry.

<TR>

<TD><B>-f</B>

<TD>Does not sort, enabling <B>-aU</B> and disabling <B>-Isto.</B>

<TR>

<TD><B>-G</B>

<TD>Inhibits display of group information.

<TR>

<TD><B>-g</B>

<TD>Ignored by <B>dir</B>; included for compatibility reasons.

<TR>

<TD><B>-IPattern</B>

<TD>Ignores entries matching PATTERN.

<TR>

<TD><B>-I</B>

<TD>Prints the index number of each file.

<TR>

<TD><B>-k</B>

<TD>Uses 1024 blocks, not 512.

<TR>

<TD><B>-L</B>

<TD>Lists enteries pointed to by symbolic links.

<TR>

<TD><B>-l</B>

<TD>Uses a long listing format.

<TR>

<TD><B>-m</B>

<TD>Fills the width with a comma-separated list of entries.

<TR>

<TD><B>-N</B>

<TD>Does not quote entry names.

<TR>

<TD><B>-n</B>

<TD>Lists numeric UIDs and GIDs instead of names.

<TR>

<TD><B>-o</B>

<TD>Displays files in color according to type.

<TR>

<TD><B>-p</B>

<TD>Appends a character for typing each entry.

<TR>

<TD><B>-Q</B>

<TD>Encloses entry names in double quotes.

<TR>

<TD><B>-q</B>

<TD>Prints a question mark (?) instead of nongraphic characters.

<TR>

<TD><B>-R</B>

<TD>Lists subdirectories recursively.

<TR>

<TD><B>-r</B>

<TD>Lists in reverse order while sorting.

<TR>

<TD><B>-S</B>

<TD>Sorts by file size.

<TR>

<TD><B>-S</B>

<TD>Prints the block size of each file.

<TR>

<TD><B>-Tcols</B>

<TD>Sets tab stops at each <I>cols</I> instead of 8.

<TR>

<TD VALIGN="TOP"><B>-t</B>

<TD>Sorts by modification time; displays the modification time when used with -1.

<TR>

<TD><B>-U</B>

<TD>List enteries in directory order, without any sorting performed.

<TR>

<TD><B>-u</B>

<TD>Sorts by last access time; displays this time when used with <B>-1.</B>

<TR>

<TD><B>-wcols</B>

<TD>Assumes a screen width of <I>cols</I> instead of current value.

<TR>

<TD><B>-X</B>

<TD>Sorts alphabetically by extension.

<TR>

<TD><B>-x</B>

<TD>Lists enteries by lines instead of by columns.

<TR>

<TD><B>-1</B>

<TD>Lists one file per line.

</TABLE>

<P><FONT SIZE="+1"><B>file......<TT>Determine File Type</TT></B></FONT></P>

<P><B>file</B> <I>option(s) filename</I></P>

<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>

<P>The <B>file</B> command returns the file type of a given file. Sometimes the magic file (<B>/etc/magic</B>) must be consulted. Don&#146;t put a lot of stock into the information returned&#151;the information returned by this command is not always correct, and it works best when detecting text-based or text-oriented file types, like ASCII files, shell scripts, PostScript files, and commands.</P>

<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>

<TABLE WIDTH="100%">

<TR>

<TD WIDTH="20%"><B>-c</B>

<TD WIDTH="80%">Checks the magic file automatically.

<TR>

<TD><B>-f list</B>

<TD>Runs the <B>file</B> command on the files in <B>list</B>.

<TR>

<TD><B>-L</B>

<TD>Follows symbolic links.

<TR>

<TD><B>-m file</B>

<TD>Checks <I>file</I> for file types instead of the magic file.

<TR>

<TD><B>-z</B>

<TD>Checks compressed files.

</TABLE>

<P><FONT SIZE="+1"><B>find......<TT>Find Files</TT></B></FONT></P>

<IMG SRC="images/05-90i.jpg"><P><B>find</B> <I>pathname(s) condition(s)</I></P>

<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>

<P>The <B>find</B> command finds a file. It can be just that simple, or it can be as complex as you&#146;d like. You can enter any number of conditions&#151;wildcards relating to the filename, when the file was created or last accessed, what links are present, and so on. It descends the directory tree beginning with the root directory or another directory that you name.</P>

<P>You can use the <B>find</B> command to learn if someone really knows Linux. If they use the <B>find</B> command and always place <B>-print</B> at the end of a command line, that means that know UNIX, not Linux. In standard UNIX, the <B>find</B> command requires <B>-print</B> at the end of the command line, to tell the command to print output to the screen. However, the Linux version of <B>find</B> doesn&#146;t require <B>-print</B>, since the assumption is that you always want to print to the screen. So any 1book or magazine article that includes <B>-print</B> as part of the example command lines shows that the author doesn&#146;t really know Linux.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="221-228.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="232-237.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?