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

📄 doc050.htm

📁 Reh Hat user manual. really goooood
💻 HTM
字号:
<html><body><a href="doc051.html"><img src=../icons/next.gif alt="Next"></a><a href="doc000.html"><img src=../icons/up.gif alt="Up"></a><a href="doc049.html"><img src=../icons/previous.gif alt="Previous"></a><a href="doc000.html"><img src=../icons/contents.gif alt="Contents"></a><a href="doc123.html"><img src=../icons/index.gif alt="Index"></a><hr><h2><a name="s6.1">6.1 On Line Help</a></h2><title>On Line Help</title><a name="i160">When you are looking for general help on commands and error messages,the best place to start is right on your system.  <p><h3><a name="s6.1.1">6.1.1 Man Pages</a></h3><title>Man Pages</title><a name="i161"><p>Most every command on your system has an associated ``man'' page.  Thisis documentation that you can get to instantly should you have questionsor problems.  If you were having trouble with the command <tt>ls</tt>, youcould enter <tt>man ls</tt>.  This will bring up the man page for <tt>ls</tt>.The man page is viewed through the <tt>less</tt> program, so all of theoptions to <tt>less</tt> will work while in a man page.  Some importantkey strokes are:<ul><li><tt>[q]</tt> to quit<li><tt>[Enter]</tt> to page down line by line<li><tt>[Space]</tt> to page down page by page<li><tt>[b]</tt> to page back up by one page<li><tt>[/]</tt> followed by a string and <tt>[Enter]</tt> to search fora string<li><tt>[n]</tt> to find the next occurrence of the previous search</ul><p>Sometimes viewing man pages isn't too friendly on line.  Providing youhave a working printer, you can print man pages as well.  If you don't have postscript printing capability and just want to print ASCII, youcan print man pages with: <p><blockquote><pre>man COMMAND | lpr</pre></blockquote><p>If you do have a postscript printer, you will probably want to printwith:<p><blockquote><pre>man -t COMMAND | lpr</pre></blockquote><p>In both ofthose commands substitute ``COMMAND'' for the command you are tryingto get help for.<p>Also, sometimes things have more than one man page.  Here is a tableof what is located where:<p><center><table border><tr valign=top><td colspan=1 align=left nowrap><b>Section</b> </td><td colspan=1 align=left nowrap> <b>Contents</b> </td></tr><tr valign=top><td colspan=1 align=left nowrap> 1 </td><td colspan=1 align=left nowrap> user commands</td></tr><tr valign=top><td colspan=1 align=left nowrap>2 </td><td colspan=1 align=left nowrap> system calls</td></tr><tr valign=top><td colspan=1 align=left nowrap>3 </td><td colspan=1 align=left nowrap> library calls</td></tr><tr valign=top><td colspan=1 align=left nowrap>4 </td><td colspan=1 align=left nowrap> devices</td></tr><tr valign=top><td colspan=1 align=left nowrap>5 </td><td colspan=1 align=left nowrap> file formats</td></tr><tr valign=top><td colspan=1 align=left nowrap>6 </td><td colspan=1 align=left nowrap> games</td></tr><tr valign=top><td colspan=1 align=left nowrap>7 </td><td colspan=1 align=left nowrap> miscellaneous</td></tr><tr valign=top><td colspan=1 align=left nowrap>8 </td><td colspan=1 align=left nowrap> system commands</td></tr><tr valign=top><td colspan=1 align=left nowrap>9 </td><td colspan=1 align=left nowrap> kernel internals</td></tr></table></center><p><a name="i162">So, let's say that you want to see the man page for <tt>swapon</tt>.  Youdo <tt>man swapon</tt>.  You will actually get the man page for the systemcall <tt>swapon(2)</tt>, which is the function you use in a C program to turn swap on.  Unless you are writing your own program to do it, thisprobably isn't what you want.  So, using the chart above, you can see that what you want is probably a ``system command'' and is locatedin section 8.  You can then do <tt>man 8 swapon</tt>.  All of this is because<tt>man</tt> searches the man directories in order, and then returns when itfinds the first match.<p>You can also search the man pages for strings.  You do this using <tt>man -k string_to_search_for</tt>.  This won't work, however, unlessthe makewhatis database has been created.  Under Red Hat Linux, this is done by a cron job overnight.  If you don't leave your system running overnight the database won't get created.  If that is the case, run thefollowing command as the <tt>root</tt> user:<p><blockquote><font size=-1><tt><pre>/etc/cron.weekly/makewhatis.cron</pre></tt></font></blockquote><p>Once you've done that, you could enter <tt>man -k swapon</tt>.  That command would return: <a name="i163"><p><blockquote><font size=-1><tt><pre># man -k swaponswapon, swapoff (2) - start/stop swapping to file/deviceswapon, swapoff (8) - enable/disable devices and files for paging and swapping</pre></tt></font></blockquote><p>So you can see that there are pages in section 2 and 8 both referring toswapon (and swapoff in this case). <a name="i164"> <a name="i165"><p><h3><a name="s6.1.2">6.1.2 Package Documentation</a></h3><title>Package Documentation</title><a name="i166"><a name="i167">Many packages of software have <tt>README</tt> files and otherdocumentation as part of the source package.  Red Hat Linux uses astandard place to install those documents so that you don't have toinstall the sources to look at the documents.  All of those documentsare stored in subdirectories of <tt>/usr/doc</tt>.  The subdirectorydepends on the package.  Each package that has extra documentation willcreate a directory called packagename-version-releasenumber.  Forexample, the <tt>tin</tt> package might be version 1.22 and release number 2.The path to its documentation would be <tt>/usr/doc/tin-1.22-2</tt>.<p>For the most part, the documents in this directory are ASCII.  You can usuallyview them with <tt>more filename</tt> or <tt>less filename</tt>.<a name="i168">This is nice, but what if you want to see if there is documentation fora specific command or file and you don't know the package it came from?It doesn't matter!  You can simply enter:<p><blockquote><font size=-1><tt><pre>rpm -qdf /etc/sendmail.cf</pre></tt></font></blockquote><p>This will report all the documentation from the package containing thefile <tt>/etc/sendmail.cf</tt>.  Commands like this are covered more indepth in the RPM-HOWTO , available from <tt>www.redhat.com</tt>.<p>Also, what if it's a command you need help with and the man page isn'tgood?  You could do something like:<p><blockquote><font size=-1><tt><pre>rpm -qdf `which COMMAND`</pre></tt></font></blockquote><p>Again, ``COMMAND'' is the actual command you need help with.This will work only when the command is on your path.<p><h3><a name="s6.1.3">6.1.3 HOWTOs and FAQs</a></h3><title>HOWTOs and FAQs</title><a name="i169"><a name="i170">Most of the contents of the Linux Documentation Project (LDP) areavailable in <tt>/usr/doc</tt> on your system.  <a name="i171"><p><tt>/usr/doc/HOWTO</tt> contains the ASCII versions of all the availableHOWTOs at the time we pressed the CD-ROM.  They are gzipped, so you have to use <tt>gunzip</tt> to unzip them or use a command like:<p><blockquote><font size=-1><tt><pre>zcat HAM-HOWTO.gz | more</pre></tt></font></blockquote><p>The latter will work, but is a bit less flexible than unzipping and then using <tt>more</tt>.  However, unzipping also requires more disk space unless you re-gzip the document when done.<a name="i172"><p><tt>/usr/doc/HOWTO/mini</tt> contains the ASCII versions of all theavailable mini-HOWTOs.  They are not compressed and can be viewedwith <tt>more</tt> or <tt>less</tt>.<a name="i173"><tt>/usr/doc/HTML</tt> contains the HTML versions of all the HOWTOs andthe <em>Linux Installation and Getting Started</em> guide.  To viewthings here, just use a WWW browser like <tt>redbaron</tt> <a name="i174"> from Red Hat Software, or <tt>arena</tt> <a name="i175">.  You woulddo something like:<a name="i176"> <a name="i177"><blockquote><font size=-1><tt><pre>cd /usr/doc/HTMLarena index.html</pre></tt></font></blockquote><p><tt>/usr/doc/FAQ</tt> contains ASCII version (and some HTML versions)of some popular FAQs, including the RedHat-FAQ.  All of them can beviewed using <tt>more</tt> or <tt>less</tt>.<p><h3><a name="s6.1.4">6.1.4 The ``locate'' Command</a></h3><title>The ``locate'' Command</title><a name="i178">When you don't know the full name of a command or file, but need tofind it, you can usually find it with <tt>locate</tt>.  <tt>locate</tt> usesa database to find all files on your system.  Normally, this databasegets built from a cron job every night.  This won't happen, however,if your machine isn't booted into Linux all the time.  So, if that isthe case, you may occasionally want to run the following command:<p><blockquote><font size=-1><tt><pre>/etc/cron.daily/updatedb.cron</pre></tt></font></blockquote><p>You will need to be root on your system when doing that.  That will allow<tt>locate</tt> to work properly.<p>So, if you know you need to find all the ``finger'' files, you could run:<p><blockquote><font size=-1><tt><pre>locate finger</pre></tt></font></blockquote><p>It should return something like:<p><blockquote><font size=-1><tt><pre>/usr/bin/finger/usr/lib/irc/script/finger/usr/man/man1/finger.1/usr/man/man8/in.fingerd.8/usr/sbin/in.fingerd</pre></tt></font></blockquote><p>One thing to note, however, is that <tt>locate</tt> not only returns hitsbased on file name, but also on path name.  So if you have a <tt>/home/djb/finger/</tt> directory on your system, it would get returnedalong with all files in the directory.<p><h3><a name="s6.1.5">6.1.5 ``info'' Pages</a></h3><title>``info'' Pages</title><a name="i179">While <tt>man</tt> is the most ubiquitous documentation format, <tt>info</tt>is much more powerful. It provides hypertext links to make readinglarge documents much easier and many features for the documentation writer.  There are some very complete <tt>info</tt> documentson various aspects of Red Hat (especially the portions from the GNU project).<p>To read <tt>info</tt> documentation, use the <tt>info</tt> program withoutany arguments. It will present you with a list of available documentation. Ifit can't find something, it's probably because you don't have the packageinstalled that includes that documentation. Install it with RPM and try again.<p>If you're comfortable using emacs, it has a built in browser for <tt>info</tt>documentation. Use <tt>[Ctrl-h]</tt> <tt>[Ctrl-i]</tt> to see it. <a name="i180"><p>The <tt>info</tt> system is a hypertext based system. Any highlightedtext that appears is a link leading to more information. Use <tt>[Tab]</tt>to move the cursor to the link, and press <tt>[Enter]</tt> to follow thelink. Pressing <tt>[p]</tt> returns you to the previous page, <tt>[n]</tt> moves youto the next page, and <tt>[u]</tt> goes up one level of documentation. Toexit <tt>info</tt>, press <tt>[Ctrl-x]</tt> <tt>[Ctrl-c]</tt> (control-x followed by control-c).<p>The best way to learn how to use <tt>info</tt> is to read the info documentationon it. If you read the first screen that <tt>info</tt> presents you'll beable to get started.<p><p><hr><a href="doc051.html"><img src=../icons/next.gif alt="Next"></a><a href="doc000.html"><img src=../icons/up.gif alt="Up"></a><a href="doc049.html"><img src=../icons/previous.gif alt="Previous"></a><a href="doc000.html"><img src=../icons/contents.gif alt="Contents"></a><a href="doc123.html"><img src=../icons/index.gif alt="Index"></a><hr></body></html>

⌨️ 快捷键说明

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