1996-05-16 23:18:28 +00:00
|
|
|
<!-- $Id: basics.sgml,v 1.6 1995/12/14 19:42:34 jfieber Exp $ -->
|
1995-04-28 16:19:59 +00:00
|
|
|
<!-- The FreeBSD Documentation Project -->
|
|
|
|
|
1995-06-30 17:37:53 +00:00
|
|
|
<chapt><heading>Unix Basics<label id="basics"></heading>
|
1995-04-28 16:19:59 +00:00
|
|
|
|
|
|
|
<sect>
|
1995-06-30 17:37:53 +00:00
|
|
|
<heading>The online manual<label id="basics:man"></heading>
|
1995-04-28 16:19:59 +00:00
|
|
|
|
|
|
|
<p>The most comprehensive documentation on FreeBSD is in
|
|
|
|
the form of <em>man pages</em>. Nearly every program
|
|
|
|
on the system comes with a short reference manual
|
1995-12-11 15:09:13 +00:00
|
|
|
explaining the basic operation and various arguments.
|
1995-04-28 16:19:59 +00:00
|
|
|
These manuals can be view with the
|
|
|
|
<tt><bf>man</bf></tt> command. Use of the
|
|
|
|
<tt><bf>man</bf></tt> command is simple:
|
|
|
|
<tscreen>
|
1995-06-14 18:38:56 +00:00
|
|
|
<bf>man</bf> <it>command</it>
|
1995-04-28 16:19:59 +00:00
|
|
|
</tscreen>
|
|
|
|
where <it>command</it> is the name of the command
|
1995-06-14 18:38:56 +00:00
|
|
|
you wish to learn about. For example, to learn more about
|
1995-04-28 16:19:59 +00:00
|
|
|
<tt><bf>ls</bf></tt> command type:
|
|
|
|
<tscreen>
|
1995-06-14 18:38:56 +00:00
|
|
|
% <bf>man ls</bf>
|
1995-04-28 16:19:59 +00:00
|
|
|
</tscreen>
|
|
|
|
|
|
|
|
<p>The online manual is divided up into numbered
|
|
|
|
sections:
|
|
|
|
<enum>
|
|
|
|
<item>User commands</item>
|
|
|
|
<item>System calls and error numbers</item>
|
|
|
|
<item>Functions in the C libraries</item>
|
|
|
|
<item>Device drivers</item>
|
|
|
|
<item>File formats</item>
|
|
|
|
<item>Games and other diversions</item>
|
|
|
|
<item>Miscellaneous information</item>
|
|
|
|
<item>System maintenance and operation commands</item>
|
|
|
|
</enum>
|
|
|
|
in some cases, the same topic may appear in more than
|
|
|
|
one section of the on-line manual. For example, there
|
|
|
|
is a <tt><bf>chmod</bf></tt> user command and a
|
|
|
|
<tt><bf>chmod()</bf></tt> system call. In this case,
|
|
|
|
you can tell the <tt><bf>man</bf></tt> command which
|
1995-12-11 15:09:13 +00:00
|
|
|
one you want by specifying the section:
|
1995-04-28 16:19:59 +00:00
|
|
|
<tscreen>
|
1995-06-14 18:38:56 +00:00
|
|
|
% <bf>man 1 chmod</bf>
|
1995-04-28 16:19:59 +00:00
|
|
|
</tscreen>
|
|
|
|
which will display the manual page for the user command
|
1995-10-22 00:42:14 +00:00
|
|
|
<tt><bf>chmod</bf></tt>. References to a particular
|
|
|
|
section of the on-line manual are traditionally placed
|
1995-12-11 15:09:13 +00:00
|
|
|
in parenthesis in written documentation, so
|
1995-10-22 00:42:14 +00:00
|
|
|
<tt><bf>chmod(1)</bf></tt> refers to the <tt><bf>chmod
|
1995-12-11 15:09:13 +00:00
|
|
|
</bf></tt> user command and <tt><bf>chmod(2)</bf></tt>
|
|
|
|
refers to the system call.
|
1995-04-28 16:19:59 +00:00
|
|
|
|
|
|
|
<p>This is fine if you know the name of the command and
|
1995-12-11 15:09:13 +00:00
|
|
|
simply wish to know how to use it, but what if you cannot recall the
|
1995-04-28 16:19:59 +00:00
|
|
|
command name? You can use <tt><bf>man</bf></tt> to
|
1995-06-14 18:38:56 +00:00
|
|
|
search for keywords in the command <em>descriptions</em> by
|
1995-04-28 16:19:59 +00:00
|
|
|
using the <tt><bf>-k</bf></tt> switch:
|
|
|
|
<tscreen>
|
1995-06-14 18:38:56 +00:00
|
|
|
% <bf>man -k mail</bf>
|
1995-04-28 16:19:59 +00:00
|
|
|
</tscreen>
|
|
|
|
With this command you will be presented with a list of
|
|
|
|
commands that have the keyword `mail' in their
|
1995-12-11 15:09:13 +00:00
|
|
|
descriptions. This is actually functionally equivalent to
|
|
|
|
using the <tt><bf>apropos</bf></tt> command.
|
1995-10-22 00:42:14 +00:00
|
|
|
|
1995-12-11 15:09:13 +00:00
|
|
|
<p>So, you are looking at all those fancy commands in <tt>
|
1996-05-16 23:18:28 +00:00
|
|
|
/usr/bin</tt> but do not even have the faintest idea
|
1995-12-11 15:09:13 +00:00
|
|
|
what most of them actually do? Simply do a
|
1995-10-22 00:42:14 +00:00
|
|
|
<tscreen>
|
|
|
|
% <bf>cd /usr/bin; man -f *</bf>
|
|
|
|
</tscreen>
|
|
|
|
or
|
|
|
|
<tscreen>
|
|
|
|
% <bf>cd /usr/bin; whatis *</bf>
|
|
|
|
</tscreen>
|
1995-12-11 15:09:13 +00:00
|
|
|
which does the same thing.
|
1995-04-28 16:19:59 +00:00
|
|
|
|
|
|
|
<sect>
|
1995-06-30 17:37:53 +00:00
|
|
|
<heading>GNU Info files<label id="basics:info"></heading>
|
1995-04-28 16:19:59 +00:00
|
|
|
|
|
|
|
<p>FreeBSD includes many applications and utilities
|
|
|
|
produced by the Free Software Foundation (FSF). In
|
|
|
|
addition to man pages, these programs come with more
|
1995-06-14 18:38:56 +00:00
|
|
|
extensive hypertext documents called <em>info</em>
|
|
|
|
files which can be viewed with the <tt>info</tt>
|
|
|
|
command or, if you installed <tt>emacs</tt>, the info
|
|
|
|
mode of <tt>emacs</tt>.
|
|
|
|
|
|
|
|
To use the <tt>info(1)</tt> command, simply type:
|
1995-12-14 19:42:35 +00:00
|
|
|
<tscreen>% <bf>info</bf></tscreen> For a brief
|
1995-12-11 15:09:13 +00:00
|
|
|
introduction, type <tt><bf>h</bf></tt>. For a quick
|
1995-06-14 18:38:56 +00:00
|
|
|
command reference, type <tt><bf>?</bf></tt>.
|
1995-04-28 16:19:59 +00:00
|
|
|
|
|
|
|
|