📄 134-136.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:Basic Linux Commands</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=7//-->
<!--PAGES=134-136//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="132-134.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="136-138.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading8"></A><FONT COLOR="#000077">Online Help Available in Linux</FONT></H3>
<P>Linux has help facilities available online. If you forget the exact use of a command, which option means what, or if you’re looking for the right command to use, the answer might be available straight from Linux. The two help facilities we will try out are the <TT><B>bash</B></TT> shell’s <TT><B>help</B></TT> command and the <TT><B>man</B></TT> command, which is available on almost all UNIX systems, including Linux.</P>
<H3><A NAME="Heading9"></A><FONT COLOR="#000077">The Linux Man Pages</FONT></H3>
<P>The “man” in “man pages” stands for “manual.” (As usual, the creators of UNIX shortened a long but descriptive word to a shorter, cryptic one!) Typing <TT><B>man <command></B></TT> lets you view the manual pages dealing with a particular command.</P>
<P>Try typing <TT><B>man passwd</B></TT> to see what the Linux manual has to say about the <TT><B>passwd</B></TT> command.</P>
<P>The general layout of a man page is as follows:</P>
<!-- CODE //-->
<PRE>
COMMAND(1) Linux Programmer’s Manual COMMAND(1)
NAME
command - summary of what command does
SYNOPSIS
<complete syntax of command in the standard Linux form>
DESCRIPTION
More verbose explanation of what “command” does.
OPTIONS
Lists each available option with description of what it does
FILES
lists files used by, or related to, command
SEE ALSO
command_cousin(1), command_spouse(1), etc.
BUGS
There are bugs in Linux commands??
AUTHOR
J. S. Goobly (goobly@hurdly-gurdly.boondocks)
Linux 1.0 22 June 1994 1
</PRE>
<!-- END CODE //-->
<P>The man page for <TT><B>passwd</B></TT> is actually quite understandable. Be warned, however, that man pages are often written in a very formal and stylized way that sometimes bears little resemblance to English. This is done not to baffle people, but to cram a great deal of information into as short a description as possible. For example, try entering <TT><B>man ls</B></TT>. Notice how many options are available for <TT><B>ls</B></TT> and how long it takes to explain them.</P>
<P>Although it can take practice (and careful reading!) to understand man pages, once you get used to them the first thing you’ll do when you encounter an unfamiliar command is call up the man page for that command.</P>
<H4 ALIGN="LEFT"><A NAME="Heading10"></A><FONT COLOR="#000077">Finding Keywords in Man Pages</FONT></H4>
<P>Sometimes you know what you want to do, but you don’t know which command you should use to do it. Use the keyword option by typing <TT><B>man -k <<I>keyword</I>>,</B></TT> and the <TT><B>man</B></TT> program returns the name of every command whose <TT><B>name</B></TT> entry (which includes a very brief description) contains that keyword.</P>
<P>For instance, you can search on <TT><B>manual</B></TT>:</P>
<!-- CODE SNIP //-->
<PRE>
darkstar:~$ <TT><B>man -k manual</B></TT>
man (1) - Format and display the online manual pages
whereis (1) - Locate binary, manual, and or source for program
xman (1) - Manual page display program for the X Window System
</PRE>
<!-- END CODE SNIP //-->
<P>You have to be careful to specify your keyword properly, though! Using <TT><B>directory</B></TT> as your keyword isn’t too bad, for example, but using <TT><B>file</B></TT> gives you many more entries than you will want to wade through.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>Note: </B><BR>You may have noticed that commands seem to be followed by numbers in brackets, usually <TT><B>(1)</B></TT>. This refers to the manual section. Back in the days when UNIX manuals came in printed, bound volumes, normal commands were in Section 1, files used by administrators were in Section 5, programming routines were described in Section 3, and so on. Therefore, some man pages are not about commands at all, but rather about files or system calls used in Linux!
<P>If a particular entry shows up in more than one section, <TT><B>man</B></TT> will show you the lowest-numbered entry by default. You can see higher-numbered entries by specifying the section number. For instance, Section 5 has a manual entry on the <TT><B>passwd</B></TT> file. To see this rather than the manual entry for the <TT><B>passwd</B></TT> command, type <TT><B>man 5 passwd</B></TT>.</P>
<P>In general, <TT><B>man</B> <<I>n</I>> <<I>entry</I>></TT> will find the man page for <TT><<I>entry</I>></TT> in Section <TT><<I>n</I>></TT>.<HR></FONT>
</BLOCKQUOTE>
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="132-134.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="136-138.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 + -