⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 242-247.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<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=242-247//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="237-242.html">Previous</A></TD>

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

<TD><A HREF="247-257.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P><FONT SIZE="+1"><B>locate......<TT>Locate Pattern</TT></B></FONT></P>

<P><B>locate</B> <I>option(s) pattern(s)</I></P>

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

<P>The <B>locate</B> command locates a <I>pattern</I> in a database of filenames and returns the filenames that match. A <I>pattern</I> can contain shell-style metacharacters (<B>*</B>, <B>?</B>, and <B>[]</B>), but <B>/</B> and <B>.</B> are treated as part of the filename. If there are no metacharacters, then filenames are returned in the database that contain the string anywhere. If metacharacters are included, the <B>locate</B> command displays filenames that contain the exact pattern, so use <B>*</B> at the beginning or end of a pattern with metacharacters.</P>

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

<TABLE WIDTH="100%">

<TR>

<TD WIDTH="20%" VALIGN="TOP"><B>-d path</B>

<TD>Searches the filename database in <I>path</I>, a colon-separated list of database filenames.

<TR>

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

<TD>Prints a list of options and exits.

<TR>

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

<TD>Returns <B>locate</B> version and exits.

</TABLE>

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

<DL>

<DD><B>find</B>

<DD><B>locatedb</B>

<DD><B>lockfile</B>

<DD><B>updatedb</B>

<DD><B>xargs</B>

</DL>

<P><FONT SIZE="+1"><B>locatedb......<TT>Locate File</TT></B></FONT></P>

<IMG SRC="images/05-94i.jpg"><P><B>locatedb</B> <I>option(s) pattern(s)</I></P>

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

<P>The <B>locate</B> command locates a <I>pattern</I> in a database of filenames and returns the filenames that match. A <I>pattern</I> can contain shell-style metacharacters (<B>*</B>, <B>?</B>, and <B>[]</B>), but <B>/</B> and <B>.</B> are treated as part of the filename. If there are no metacharacters, then filenames in the database are returned that contain the string anywhere. If metacharacters are included, the <B>locate</B> command displays filenames that contain the exact pattern, so use <B>*</B> at the beginning or end of a pattern with metacharacters.</P>

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

<DL>

<DD><B>find</B>

<DD><B>locate</B>

<DD><B>lockfile</B>

<DD><B>updatedb</B>

<DD><B>xargs</B>

</DL>

<P><FONT SIZE="+1"><B>lockfile......<TT>Locks File</TT></B></FONT></P>

<P><B>lockfile</B> <I>option filename</I></P>

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

<P>The <B>lockfile</B> command creates one or more semaphore files, which limit access to a file. If <B>lockfile</B> can&#146;t create the semaphore files in order, it waits for eight seconds and tries again; you can use the <B>-r</B> option to specify the number of times it will retry. The resulting files will have an access permission of <B>0</B> and need to be removed with <B>rm -f</B>.</P>

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

<TABLE WIDTH="100%">

<TR>

<TD WIDTH="20%"><B>-r num</B>

<TD>Retries <I>num</I> of times before giving up.

</TABLE>

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

<DL>

<DD><B>rm</B>

</DL>

<P><FONT SIZE="+1"><B>ls......<TT>List Files</TT></B></FONT></P>

<IMG SRC="images/05-95i.jpg"><P><B>ls</B> <I>option(s) name(s)</I></P>

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

<P>The <B>ls</B> command lists the contents of a specified directory or extended information about a specified file. If no <I>name</I> is given, then it&#146;s assumed that you want the contents of the current directory. Files are by default listed in columns, sorted vertically. While this can be a complex command, especially in the option-laden GNU version (with 38 options), chances are good that you&#146;ll stick with the <B>-F</B> and <B>-l</B> options the most, and use the <B>-u</B> and <B>-c</B> options the least.</P>

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

<TABLE WIDTH="100%">

<TR>

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

<TD WIDTH="80%">Lists one file per line.

<TR>

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

<TD>Treats all characters outside the ASCII (ISO 646) set (0x20-0x7E) as nonprintable control characters.

<TR>

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

<TD>Treats all characters from the 8-bit ISO 8859 character sets (0x20-0x7E, 0xA1-0xFF) as printable, including ASCII. (Default.)

<TR>

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

<TD>Lists all files in a directory, including hidden files.

<TR>

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

<TD>Lists all the contents of a directory, except for <B>.</B> and <B>&#133;</B>

<TR>

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

<TD>Displays nongraphic characters using alphabetic and octal backslash sequences like those used in C.

<TR>

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

<TD>Ignores backups (files ending with <B>~</B>),

<TR>

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

<TD>Sorts contents according to status change time.

<TR>

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

<TD>Lists files in columns, sorted vertically.

<TR>

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

<TD>Lists directories like other files, without their contents.

<TR>

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

<TD>Lists all times in full.

<TR>

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

<TD>Displays contents as found in disk, and not sorted in any way.

<TR>

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

<TD>Lists the file types by character: <B>/</B> for directories, <B>&#64;</B> for symbolic links, <B>|</B> for FIFOs, <B>=</B> for sockets, and nothing for regular files.

<TR>

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

<TD>Omits group ownership when listing files in long format.

<TR>

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

<TD>Displays an index number of each file.

<TR>

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

<TD>Ignores files that match <I>pattern</I>.

<TR>

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

<TD>Lists file sizes in kilobytes.

<TR>

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

<TD>Lists files in long format, including the file type, permissions, number of hard links, owner name, group name, size in bytes, and timestamp (the modification time unless other times are selected).

<TR>

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

<TD>Displays files by symbolic links instead of listing the contents of the links.

<TR>

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

<TD>Lists files horizontally, separated by commas.

<TR>

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

<TD>Lists the numeric UID and GID instead of the filenames.

<TR>

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

<TD>Omits filenames from the listings.

<TR>

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

<TD>Toggles the display of the files by colors.

<TR>

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

<TD>Appends a character to each filename indicating the type.

<TR>

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

<TD>Prints question marks in the place of nongraphic characters in filenames.

<TR>

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

<TD>Encloses filenames in double quotes (&#147;) and display nongraphic characters like those used in C.

<TR>

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

<TD>Sorts filenames in reverse order.

<TR>

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

<TD>Lists contents of directories recursively.

<TR>

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

<TD>Prints the size of the file (in 1K blocks) to the left of the filename.

<TR>

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

<TD>Sorts files by file size, not alphabetically, with the largest files first.

<TR>

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

<TD>Sorts files by timestamp (newest first) instead of alphabetically.

<TR>

<TD VALIGN="TOP"><B>-T<I>cols</I></B>

<TD>Sets the tab stops at <I>cols</I> columns. The default is 8. Setting <I>0</I> disables tabs.

<TR>

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

<TD>Sorts files by the last time they were accessed, not modified.

<TR>

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

<TD>Displays contents as found in disk, and not sorted in any way.

<TR>

<TD><B>-w <I>cols</I></B>

<TD>Sets the screen as <I>cols</I> characters wide. The default is 80.

<TR>

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

<TD>Prints listings in columns, sorted horizontally.

<TR>

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

<TD>Sorts files alphabetically by file extensions.

</TABLE>

<P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="237-242.html">Previous</A></TD>

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

<TD><A HREF="247-257.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





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

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

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