Added
<!--
Local Variables:
mode: sgml
sgml-declaration: "../chapter.decl"
sgml-indent-data: t
sgml-omittag: nil
sgml-shorttag: nil
sgml-always-quote-attributes: t
sgml-minimize-attributes: max
sgml-parent-document: ("../handbook.sgml" "part" "chapter")
End:
-->
to the bottom of each chapter.sgml file so that Emacs can do the right
thing.
150 lines
4.9 KiB
Text
150 lines
4.9 KiB
Text
<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>
|
|
|
|
<informalexample>
|
|
<screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput>
|
|
</screen>
|
|
</informalexample>
|
|
|
|
<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>
|
|
<informalexample>
|
|
<screen>&prompt.user; <userinput>man ls</userinput></screen>
|
|
</informalexample>
|
|
|
|
<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>
|
|
|
|
</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>
|
|
|
|
<informalexample>
|
|
<screen>&prompt.user; <userinput>man 1 chmod</userinput></screen>
|
|
</informalexample>
|
|
|
|
<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 <citerefentry><refentrytitle>chmod</refentrytitle><manvolnum>1</manvolnum></citerefentry> refers to the
|
|
<command>chmod</command>
|
|
user command and <citerefentry><refentrytitle>chmod</refentrytitle><manvolnum>2</manvolnum></citerefentry> 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>
|
|
|
|
<informalexample>
|
|
<screen>&prompt.user; <userinput>man -k mail</userinput></screen>
|
|
</informalexample>
|
|
|
|
<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
|
|
|
|
<informalexample>
|
|
<screen>&prompt.user; <userinput>cd /usr/bin; man -f *</userinput></screen>
|
|
</informalexample>
|
|
|
|
or
|
|
|
|
<informalexample>
|
|
<screen>&prompt.user; <userinput>cd /usr/bin; whatis *</userinput></screen>
|
|
</informalexample> 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 <citerefentry><refentrytitle>info</refentrytitle><manvolnum>1</manvolnum></citerefentry> command, simply type:</para>
|
|
|
|
<informalexample>
|
|
<screen>&prompt.user; <userinput>info</userinput></screen>
|
|
</informalexample>
|
|
|
|
<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-shorttag: nil
|
|
sgml-always-quote-attributes: t
|
|
sgml-minimize-attributes: max
|
|
sgml-parent-document: ("../handbook.sgml" "part" "chapter")
|
|
End:
|
|
-->
|
|
|