139 lines
4.6 KiB
Text
139 lines
4.6 KiB
Text
<!--
|
|
The FreeBSD Documentation Project
|
|
|
|
$Id: chapter.sgml,v 1.9 1999-04-08 21:30:16 nik Exp $
|
|
-->
|
|
|
|
<chapter id="basics">
|
|
<title>Unix Basics</title>
|
|
|
|
<sect1 id="basics-man">
|
|
<title>The Online Manual</title>
|
|
|
|
<para>The most comprehensive documentation on FreeBSD is in the form of
|
|
<emphasis>man pages</emphasis>. Nearly every program on the system
|
|
comes with a short reference manual explaining the basic operation and
|
|
various arguments. These manuals can be view with the
|
|
<command>man</command> command. Use of the <command>man</command>
|
|
command is simple:</para>
|
|
|
|
<screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput></screen>
|
|
|
|
<para><replaceable>command</replaceable> is the name of the command you
|
|
wish to learn about. For example, to learn more about
|
|
<command>ls</command> command type:</para>
|
|
|
|
<screen>&prompt.user; <userinput>man ls</userinput></screen>
|
|
|
|
<para>The online manual is divided up into numbered sections:</para>
|
|
|
|
<orderedlist>
|
|
<listitem>
|
|
<para>User commands</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>System calls and error numbers</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>Functions in the C libraries</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>Device drivers</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>File formats</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>Games and other diversions</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>Miscellaneous information</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>System maintenance and operation commands</para>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<para>Kernel developers</para>
|
|
</listitem>
|
|
</orderedlist>
|
|
|
|
<para>In some cases, the same topic may appear in more than one section of
|
|
the on-line manual. For example, there is a <command>chmod</command>
|
|
user command and a <function>chmod()</function> system call. In this
|
|
case, you can tell the <command>man</command> command which one you want
|
|
by specifying the section:</para>
|
|
|
|
<screen>&prompt.user; <userinput>man 1 chmod</userinput></screen>
|
|
|
|
<para>This will display the manual page for the user command
|
|
<command>chmod</command>. References to a particular section of the
|
|
on-line manual are traditionally placed in parenthesis in written
|
|
documentation, so &man.chmod.1; refers to the
|
|
<command>chmod</command> user command and &man.chmod.2; refers to the
|
|
system call.</para>
|
|
|
|
<para>This is fine if you know the name of the command and simply wish to
|
|
know how to use it, but what if you cannot recall the command name? You
|
|
can use <command>man</command> to search for keywords in the command
|
|
<emphasis>descriptions</emphasis> by using the <option>-k</option>
|
|
switch:</para>
|
|
|
|
<screen>&prompt.user; <userinput>man -k mail</userinput></screen>
|
|
|
|
<para>With this command you will be presented with a list of commands that
|
|
have the keyword “mail” in their descriptions. This is
|
|
actually functionally equivalent to using the <command>apropos</command>
|
|
command.</para>
|
|
|
|
<para>So, you are looking at all those fancy commands in
|
|
<filename>/usr/bin</filename> but do not even have the faintest idea
|
|
what most of them actually do? Simply do a
|
|
|
|
<screen>&prompt.user; <userinput>cd /usr/bin; man -f *</userinput></screen>
|
|
|
|
or
|
|
|
|
<screen>&prompt.user; <userinput>cd /usr/bin; whatis *</userinput></screen>
|
|
|
|
which does the same thing.</para>
|
|
</sect1>
|
|
|
|
<sect1 id="basics-info">
|
|
<title>GNU Info Files</title>
|
|
|
|
<para>FreeBSD includes many applications and utilities produced by the
|
|
Free Software Foundation (FSF). In addition to man pages, these
|
|
programs come with more extensive hypertext documents called
|
|
“info” files which can be viewed with the
|
|
<command>info</command> command or, if you installed
|
|
<command>emacs</command>, the info mode of
|
|
<command>emacs</command>.</para>
|
|
|
|
<para>To use the &man.info.1; command, simply type:</para>
|
|
|
|
<screen>&prompt.user; <userinput>info</userinput></screen>
|
|
|
|
<para>For a brief introduction, type <userinput>h</userinput>. For a
|
|
quick command reference, type <userinput>?</userinput>.</para>
|
|
</sect1>
|
|
</chapter>
|
|
|
|
<!--
|
|
Local Variables:
|
|
mode: sgml
|
|
sgml-declaration: "../chapter.decl"
|
|
sgml-indent-data: t
|
|
sgml-omittag: nil
|
|
sgml-always-quote-attributes: t
|
|
sgml-parent-document: ("../handbook.sgml" "part" "chapter")
|
|
End:
|
|
-->
|
|
|