.di Revids
.na
.nf
.ft CW
.vs 10p
$Id: title.complete,v 3.6 2002/04/25 08:10:55 grog Exp grog $
$Id: preface.mm,v 4.4 2002/10/20 02:24:06 grog Exp grog $
$Id: introduction.mm,v 4.8 2002/10/13 23:49:29 grog Exp grog $
$Id: concepts.mm,v 4.5 2002/10/27 00:42:40 grog Exp grog $
$Id: evolution.mm,v 4.6 2002/10/27 00:50:44 grog Exp grog $
$Id: quickinstall.mm,v 4.3 2002/08/11 08:39:25 grog Exp grog $
$Id: shareinstall.mm,v 4.2 2002/03/31 07:31:22 grog Exp grog $
$Id: install.mm,v 4.4 2002/10/16 02:21:35 grog Exp grog $
$Id: postinstall.mm,v 4.1 2001/12/22 02:24:52 grog Exp grog $
$Id: desktop.mm,v 4.4 2002/08/12 02:18:08 grog Exp grog $
$Id: ports.mm,v 4.4 2002/08/12 04:41:38 grog Exp grog $
$Id: problems.mm,v 4.4 2002/10/19 04:28:14 grog Exp grog $
$Id: extras.mm,v 4.3 2002/10/12 05:08:01 grog Exp grog $
$Id: xtheory.mm,v 4.2 2002/04/13 07:40:43 grog Exp grog $
$Id: unixref.mm,v 4.5 2002/10/11 04:40:30 grog Exp grog $
$Id: starting.mm,v 4.8 2002/10/27 00:45:40 grog Exp grog $
$Id: configfiles.mm,v 4.6 2002/10/14 07:46:42 grog Exp grog $
$Id: filesys.mm,v 4.6 2002/09/18 08:21:25 grog Exp grog $
$Id: disks.mm,v 4.7 2002/10/27 00:49:54 grog Exp grog $
$Id: vinum.mm,v 4.4 2002/10/27 00:47:07 grog Exp grog $
$Id: burncd.mm,v 4.2 2002/07/19 03:56:46 grog Exp grog $
$Id: tapes.mm,v 4.3 2002/04/21 07:39:25 grog Exp grog $
$Id: printers.mm,v 4.5 2002/08/11 07:10:08 grog Exp grog $
$Id: building.mm,v 4.2 2002/10/19 06:56:40 grog Exp grog $
$Id: current.mm,v 4.1 2002/01/01 02:22:25 grog Exp grog $
$Id: upgrade.mm,v 1.3 2002/10/24 03:40:27 grog Exp grog $
$Id: emulate.mm,v 4.3 2002/09/13 08:01:11 grog Exp grog $
$Id: netintro.mm,v 4.4 2002/10/24 05:31:18 grog Exp grog $
$Id: netsetup.mm,v 4.4 2002/10/11 04:44:31 grog Exp grog $
$Id: isp.mm,v 4.2 2002/04/25 07:47:56 grog Exp grog $
$Id: modems.mm,v 4.2 2002/06/16 08:05:08 grog Exp grog $
$Id: ppp.mm,v 4.5 2002/10/21 09:10:26 grog Exp grog $
$Id: dns.mm,v 4.4 2002/04/25 06:27:42 grog Exp grog $
$Id: firewall.mm,v 4.1 2002/03/23 04:59:20 grog Exp grog $
$Id: netdebug.mm,v 4.1 2002/03/03 05:28:13 grog Exp grog $
$Id: nfs.mm,v 4.3 2002/10/27 00:50:18 grog Exp grog $
$Id: netclient.mm,v 4.2 2002/10/27 01:50:44 grog Exp grog $
$Id: netserver.mm,v 4.2 2002/10/27 07:23:01 grog Exp grog $
$Id: mua.mm,v 4.3 2002/10/19 06:57:56 grog Exp grog $
$Id: mta.mm,v 4.4 2002/10/19 06:58:01 grog Exp grog $
$Id: micronet.mm,v 4.1 2002/03/16 05:35:14 grog Exp grog $
$Id: terminology.mm,v 4.1 1999/05/15 06:51:17 grog Exp grog $
$Id: biblio.mm,v 4.1 1999/05/15 06:51:42 grog Exp grog $
$Id: tmac.Mn,v 1.2 2002/10/29 06:02:43 grog Exp grog $
.br
.ft
.ad
.fi
.vs
.di
.ds os FreeBSD
.ds osver 5.0-CURRENT
.ds formatdate 29 October 2002
.ds RCS-ID
.\" This file is in -*- nroff-fill -*- mode
.\" STATUS: draft 4th edition
.\"
.\" $Id: preface.mm,v 4.4 2002/10/20 02:24:06 grog Exp grog $
.\"
.Chapter 0 Preface
FreeBSD is a high-performance operating system derived from the \fIBerkeley
Software Distribution\fP, or \fIBSD\fP, the version of UNIX developed at the
University of California at Berkeley between 1975 and 1993.  FreeBSD is not a
UNIX clone.  Historically and technically, it has greater rights than UNIX
System V to be called \fIUNIX\fP.  Legally, it may not be called UNIX, since
UNIX is now a registered trade mark of The Open Group.
.P
This book is intended to help you get FreeBSD up and running on your system and
to familiarize you with it.  It can't do everything, but plenty of UNIX books
and online documentation are available, and a large proportion of them are
directly applicable to FreeBSD.  In the course of the text, I'll repeatedly
point you to other documentation.
.P
I'm not expecting you to be a guru, but I do expect you to understand the basics
of using UNIX.  If you've come from a Microsoft background, I'll try to make the
transition a little less rocky.
.H2 "The fourth edition"
This book has already had quite a history.  Depending on the way you count, this
is the fourth or fifth edition of \fIThe Complete FreeBSD\fP\|: the first
edition of the book was called \fIInstalling and Running FreeBSD\fP, and was
published in March 1996.  The next edition was called ``The Complete FreeBSD'',
first edition.  The first three editions were published by Walnut Creek CDROM,
which ceased publishing activities in 2000.  This is the first edition to be
published by O'Reilly and Associates.
.P
During this time, FreeBSD has changed continually, and it's difficult for a book
to keep up with the change.  This doesn't mean that FreeBSD has changed beyond
recognition, but people have done a great job of working away those little rough
edges which make the difference between a usable operating system and one which
is a pleasure to use.  If you come to FreeBSD from System V, you'll certainly
notice the difference.
.P
During the lifetimes of the previous editions of this book, I realised that much
of the text becomes obsolete very quickly.  For example, in the first edition I
went to a lot of trouble to tell people how to install from an ATAPI CD-ROM,
since at the time the support was a little wobbly.  Almost before the book was
released, the FreeBSD team improved the support and rolled it into the base
release.  The result?  Lots of mail messages to the \f(CWFreeBSD-questions\fP
mailing list saying, ``Where can I get \fIATAPI.FLP\fP\|?''.  Even the
frequently posted errata list didn't help much.
.P
This kind of occurrence brings home the difference in time scale between
software releases and book publication.  FreeBSD CD-ROMs are released every
three months.  A new edition of a book every year is considered very frequent,
but it obviously can't hope to keep up with the software release cycle.  As a
result, this book contains less time-sensitive material than previous editions.
For example, the chapter on building kernels no longer contains an in-depth
discussion of the kernel build parameters.  They change too frequently, and the
descriptions, though correct at the time of printing, proved to be confusing.
Instead, the chapter explains where to find the up-to-date information.
.P
Another thing that we discovered was that the book was too big.  The Second
Edition contained 1,100 pages of man pages, the FreeBSD manual pages which are
also installed online on the system.  These printed pages were easier to read,
but they had two disadvantages: firstly, they were slightly out of date compared
to the online version, and secondly they weighed about 1 kilogram (2.2 lbs).
The book was just plain unwieldy, and some people reported that they had
physically torn out the man pages from the book to make it more manageable.  As
a result, the third edition had only the most necessary man pages.
.P
Times have changed since then.  At the time, ``The Complete FreeBSD'' was the
only English-language book on FreeBSD.  Now there are several\(emsee the
bibliography for more detail.  In particular, the FreeBSD online handbook is
available both in printed form and online at
\fIhttp://www.freebsd.org/handbook/index.html\fP, so I have left much of the
more time-sensitive out of this book.  Alternatively, you can print out the man
pages yourself\(emsee page \*[howto-print-manpages] for details.
.P
It's very difficult to find a good sequence for presenting that material in this
book.  In many cases, there is a chicken and egg problem: what do you need to
know first?  Depending on what you need to do, you need to get information in
different sequences.  I've spent a lot of time trying to present the material in
the best possible sequence, but inevitably you're going to find that you'll have
to jump through one of the myriad page cross references.
.H2 "Conventions used in this book"
.Pn conventions
In this book, I use \fBbold\fP for the names of keys on the keyboard.  We'll see
more about this in the next section.
.P
I use \fIitalic\fP\| for the names of UNIX utilities, directories, filenames and
\fIURL\fP\|s (\fIUniform Resource Locators\fP, the new file naming technology
which you'll know from the World-Wide Web), and to emphasize new terms and
concepts when they are first introduced.  I also use this font for comments in
the examples.
.P
.X "Internet News"
I use \f(CWconstant Width\fP in examples to show the contents of files, the
output from commands, program variables, actual values of keywords, for mail
IDs, for the names of \fIInternet News\fP\| newsgroups, and in the text to
represent commands.
.P
I use \f(CIconstant Italic\fP in examples to show variables for which
context-specific substitutions should be made.  For example, the variable
\f(CIfilename\fP would be replaced by an actual filename.
.P
I use \f(CBconstant Bold\fP in examples to show commands or text that would be
typed in literally by the user.
.P
In this book, I recommend the use of the Bourne shell or one of its descendents
(\fIsh\fP, \fIbash\fP, \fIpdksh\fP, \fIksh\fP\| or \fIzsh\fP\|).  \fIsh\fP\| is
in the base system, and the rest are all in the Ports Collection.  I personally
use the \fIbash\fP\| shell.
.P
This is a personal preference, and a recommendation, but it's not the standard
shell.  The standard BSD shell is the C shell (\fIcsh\fP\|), which has a
fuller-featured descendent \fItcsh\fP.  In particular, the standard installation
sets the \fIroot\fP\| user up with a \fIcsh\fP.  See page \*[chsh] for details
of how to change the shell.
.P
In most examples, I'll show the shell prompt as \f(CW$\fP, but it doesn't
normally matter which shell you use.  In some cases, however, it does:
.Ls B
.LI
Sometimes you need to be super-user, which I'll indicate by using the prompt
\f(CW#\fP.
.LI
Sometimes the commands only work with the Bourne Shell and derivatives
(\fIzsh\fP\|, \fIbash\fP\|), and they won't work with \fIcsh\fP\|, \fItcsh\fP\|, and
friends.  In these cases I'll show the \fIcsh\fP\| alternative with the standard
\fIcsh\fP\| prompt \f(CW%\fP.
.Le
.Aside
In the course of the text I'll occasionally touch on a subject which is not of
absolute importance, but which may be of interest.  I'll print them in smaller
text, like this.
.End-aside
.H3 "Describing the keyboard"
One of the big differences between UNIX and other operating systems concerns the
way they treat so-called ``carriage control codes.''
.Aside
.X "carriage return"
.X "line feed"
When UNIX was written, the standard interactive terminal was still the Teletype
model KSR 35.  This mechanical monstrosity printed at 10 characters per second,
and the control characters really did cause physical motion.  The two most
important characters were \fICarriage Return\fP\|, which moved the carriage
(which carried the print head) to the left margin, and \fILine Feed\fP\|, which
turned the platen to advance the paper by the height of a line.  To get to the
beginning of a new line, you needed to issue both control characters.  We don't
have platens or carriages any more, but the characters are still there, and in
systems like DOS, a line of text will be terminated by a carriage return
character and a line feed character.  UNIX only uses a ``new line'' character,
which corresponds to the line feed.
.End-aside
.X "any, key"
.X "key, any"
It's surprising how many confusing terms exist to describe individual keys on
the keyboard.  My favourite is the \fIany\fP\| key (``\f(CWPress any key to
continue\fP'').  We won't be using the \fIany\fP\| key in this book, but there
are a number of other keys whose names need understanding.
.Ls B
.LI
.X "Enter, key"
.X "key, Enter"
.X "Return, key"
.X "key, Return"
The \fIEnter\fP\| or \fIReturn\fP\| key.  I'll call this \fBENTER\fP.
.LI
Control characters (characters produced by holding down the \fBCtrl\fP key and
pressing a normal keyboard key at the same time).  I'll show them as, for
example, \fBCtrl-D\fR in the text, but these characters are frequently echoed on
the screen as a caret (^) followed by the character entered, so in the examples,
you may see things like \f(CW^D\fP.
.LI
The \fBAlt\fP key, which Emacs afficionados call a \fBMETA\fP key, works in the
same way as the \fBCtrl\fP key, but it generates a different set of characters.
These are sometimes abbreviated by prefixing the character with a tilde
(\fB~\fP) or the characters \fBA-\fP.  I personally like this method better, but
to avoid confusion I'll represent the character generated by holding down the
\fBAlt\fP key and pressing \f(CWD\fP as \fBAlt-D\fP.
.LI
.X "new line, key"
.X "key, new line"
\fBNL\fP is the \fInew line\fP\| character.  In ASCII, it is \fBCtrl-J\fP, but
UNIX systems generate it when you press the \fBENTER\fP key.  UNIX also refers
to this character as \f(CW\en\fP, a usage which comes from the C programming
language.
.LI
.X "carriage return, key"
.X "key, carriage return"
\fBCR\fP is the \fIcarriage return\fP\| character, in ASCII \fBCtrl-M\fP.  Most
systems generate it with the \fBENTER\fP key.  UNIX also refers to this
character as \f(CW\er\fP\(emagain, this comes from the C programming language.
.LI
.X "horizontal tab, key"
.X "key, horizontal tab"
\fBHT\fP is the ASCII \fIhorizontal tab\fP\| character, \fBCtrl-I\fP.  Most
systems generate it when the \fBTAB\fP key is pressed.  UNIX and C also refer to
this character as \f(CW\et\fP.
.LE
.H2 "Acknowledgements"
This book is based on the work of many people, first and foremost the FreeBSD
documentation project.  Significant parts of the first edition were derived from
the FreeBSD handbook, in particular \*[chunixref].  The FreeBSD handbook is
supplied as on-line documentation with the FreeBSD release\(emsee page
\*[handbook] for more information.
.H3 "Book reviewers"

Fourth edition:

Hiten Pandya
Jonathan Arnold (1 little)
Linh Pham



.X "Hubbard, Jordan"
.X "Palmer, Gary"
.X "Bishop, Bob"
.X "Elischer, Julian"
.X "Esser, Stefan"
.X "Fieber, John"
.X "Foster, Glen"
.X "Smith, Michael"
.X "Williams, Nate"
.X "Kamp, Poul-Henning"


This book wouldn't be the same without the help of a small group of dedicated
critics who tried out what I said and pointed out that it didn't work.  In
particular, I'd like to thank Jack Velte of Walnut Creek CDROM, who had the idea
of this book in the first place, Jordan Hubbard and Gary Palmer for tearing the
structure and content apart multiple times, and also Bob Bishop, Julian
Elischer, Stefan Esser, John Fieber, Glen Foster, Poul-Henning Kamp, Michael
Smith, and Nate Williams for valuable contributions (``what, you expect new
users to know that you have to shut down the machine before powering it
off?''). [See page \*[shutdown] for details on how to shut down the system].
.X "Ritter, Andreas"
.X "Mllers, Josef"
.X "Velte, Jack"
Finally, special thanks to Josef Mllers, Andreas Ritter, and Jack Velte, who
put drafts of this book through its paces and actually installed FreeBSD with
their help.
.P
The second edition had much more review than the first.  A number of dedicated
reviewers held through for several months as I gradually cranked out usable
copy.  In particular, special thanks to:
.P
.X "Anderson, Annelise"
Annelise Anderson, 
.X "Blake, Sue"
Sue Blake, 
.X "Bresler, Jonathan M."
Jonathan M. Bresler, 
.X "Bulley, William"
William Bulley, 
.X "Cambria, Mike"
Mike Cambria, 
.X "Clapper, Brian"
Brian Clapper,
.X "Coyne, Paul"
Paul Coyne, 
.X "Crites, Lee"
Lee Crites, 
.X "Dunham, Jerry"
Jerry Dunham, 
.X "Esser, Stefan"
Stefan Esser, 
.X "Gardella, Patrick"
Patrick Gardella, 
.X "Giovannelli, Gianmarco"
Gianmarco Giovannelli, 
.X "Kelly, David"
David Kelly, 
.X "Klemm, Andreas"
Andreas Klemm, 
.X "Lind, John"
John Lind, 
.X "MacIntyre, Andrew"
Andrew MacIntyre, 
.X "Michaels, Jonathan"
Jonathan Michaels, 
.X "Micheel, Jrg"
Jrg Micheel, 
.X "Molteni, Marco"
Marco Molteni, 
.X "Mott, Charles"
Charles Mott, 
.X "Nelson, Jay D."
Jay D. Nelson, 
.X "O'Connor, Daniel J."
Daniel J. O'Connor, 
.X "Perry, Andrew"
Andrew Perry, 
.X "Peters, Kai"
Kai Peters, 
.X "Peters, Wes"
Wes Peters, 
.X "Prior, Mark"
Mark Prior, 
.X "Rooij, Guido van"
Guido van Rooij, 
.X "Roznowski, Stephen J."
Stephen J. Roznowski, 
.X "Rutherford, Andrew"
Andrew Rutherford
.X "Vickery, Thomas"
Thomas Vickery,
.X "Wilde, Don"
Don Wilde.
.X "Birrell, John"
.X "Endsley, Michael A."
.P
Many of the Second Edition reviewers came back for the Third Edition.  In
addition, thanks to John Birrell for his help with the Alpha architecture, and
Michael A. Endsley for ferreting out bugs, some of which had been present since
the days of ``Installing and Running FreeBSD''.
.H3 "Other assistance"
Thanks also to David Lloyd for the loan of an ATA CD-R drive while writing the
ATA section of \*[chburn].
.H3 "Feedback"
As I state at the beginning of the book, I welcome feedback about errors in the
text.  Over the course of the years, a number of people have sent me
corrections.  Thanks go to
.X "Garcia Cuesta, Manuel Enrique"
Manuel Enrique Garcia Cuesta, for helping make this book more legible and more
accurate.
.H2 "How this book was written"
.di Revids
.na
.nf
.ft CW
.vs 10p
$Id: title.complete,v 3.6 2002/04/25 08:10:55 grog Exp grog $
$Id: preface.mm,v 4.4 2002/10/20 02:24:06 grog Exp grog $
$Id: introduction.mm,v 4.8 2002/10/13 23:49:29 grog Exp grog $
$Id: concepts.mm,v 4.5 2002/10/27 00:42:40 grog Exp grog $
$Id: evolution.mm,v 4.6 2002/10/27 00:50:44 grog Exp grog $
$Id: quickinstall.mm,v 4.3 2002/08/11 08:39:25 grog Exp grog $
$Id: shareinstall.mm,v 4.2 2002/03/31 07:31:22 grog Exp grog $
$Id: install.mm,v 4.4 2002/10/16 02:21:35 grog Exp grog $
$Id: postinstall.mm,v 4.1 2001/12/22 02:24:52 grog Exp grog $
$Id: desktop.mm,v 4.4 2002/08/12 02:18:08 grog Exp grog $
$Id: ports.mm,v 4.4 2002/08/12 04:41:38 grog Exp grog $
$Id: problems.mm,v 4.4 2002/10/19 04:28:14 grog Exp grog $
$Id: extras.mm,v 4.3 2002/10/12 05:08:01 grog Exp grog $
$Id: xtheory.mm,v 4.2 2002/04/13 07:40:43 grog Exp grog $
$Id: unixref.mm,v 4.5 2002/10/11 04:40:30 grog Exp grog $
$Id: starting.mm,v 4.8 2002/10/27 00:45:40 grog Exp grog $
$Id: configfiles.mm,v 4.6 2002/10/14 07:46:42 grog Exp grog $
$Id: filesys.mm,v 4.6 2002/09/18 08:21:25 grog Exp grog $
$Id: disks.mm,v 4.7 2002/10/27 00:49:54 grog Exp grog $
$Id: vinum.mm,v 4.4 2002/10/27 00:47:07 grog Exp grog $
$Id: burncd.mm,v 4.2 2002/07/19 03:56:46 grog Exp grog $
$Id: tapes.mm,v 4.3 2002/04/21 07:39:25 grog Exp grog $
$Id: printers.mm,v 4.5 2002/08/11 07:10:08 grog Exp grog $
$Id: building.mm,v 4.2 2002/10/19 06:56:40 grog Exp grog $
$Id: current.mm,v 4.1 2002/01/01 02:22:25 grog Exp grog $
$Id: upgrade.mm,v 1.3 2002/10/24 03:40:27 grog Exp grog $
$Id: emulate.mm,v 4.3 2002/09/13 08:01:11 grog Exp grog $
$Id: netintro.mm,v 4.4 2002/10/24 05:31:18 grog Exp grog $
$Id: netsetup.mm,v 4.4 2002/10/11 04:44:31 grog Exp grog $
$Id: isp.mm,v 4.2 2002/04/25 07:47:56 grog Exp grog $
$Id: modems.mm,v 4.2 2002/06/16 08:05:08 grog Exp grog $
$Id: ppp.mm,v 4.5 2002/10/21 09:10:26 grog Exp grog $
$Id: dns.mm,v 4.4 2002/04/25 06:27:42 grog Exp grog $
$Id: firewall.mm,v 4.1 2002/03/23 04:59:20 grog Exp grog $
$Id: netdebug.mm,v 4.1 2002/03/03 05:28:13 grog Exp grog $
$Id: nfs.mm,v 4.3 2002/10/27 00:50:18 grog Exp grog $
$Id: netclient.mm,v 4.2 2002/10/27 01:50:44 grog Exp grog $
$Id: netserver.mm,v 4.2 2002/10/27 07:23:01 grog Exp grog $
$Id: mua.mm,v 4.3 2002/10/19 06:57:56 grog Exp grog $
$Id: mta.mm,v 4.4 2002/10/19 06:58:01 grog Exp grog $
$Id: micronet.mm,v 4.1 2002/03/16 05:35:14 grog Exp grog $
$Id: terminology.mm,v 4.1 1999/05/15 06:51:17 grog Exp grog $
$Id: biblio.mm,v 4.1 1999/05/15 06:51:42 grog Exp grog $
$Id: tmac.Mn,v 1.2 2002/10/29 06:02:43 grog Exp grog $
.br
.ft
.ad
.fi
.vs
.di
.ds os FreeBSD
.ds osver 5.0-CURRENT
.ds formatdate 29 October 2002
.ds RCS-ID
This book was written and typeset almost entirely with tools supplied as
standard with the FreeBSD system.  The only exception was the Garamond font,
which we can't supply with FreeBSD because it requires a license.
.fam T
Without this font, the book would look much the same: it would just be in Times
Roman, like this sentence here.
.fam G
.P
.X Emacs
The text of this book was written with the GNU \fIEmacs\fP\| editor, and it was
formatted with the GNU \fIgroff\fP\| text formatter, version \n(.x.\n(.y, and
some heavily modified \fImm\fP\| macros.  The man pages were formed with
\fIan\fP\| and \fIdoc\fP\| macros, slightly modified to produce a table of
contents entry, an index entry, and correct page sizing.  The process was
performed under \*[os] \*[osver].\*F
.FS
See \*[chcurrent], for a description of -CURRENT.
.FE
Even the development versions of FreeBSD are stable enough to perform heavy-duty
work like professional text formatting.
.sp
The source files for this book are kept under \fIRCS\fP, the \fIRevision Control
System\fP (see the man page \fIrcs(1)\fP\|).  Here are the RCS Version IDs for
the chapters of this particular book.  If you have a comment about a particular
chapter, it will help if you can tell me the version ID.
.br
.Pn RCS-Ids
.nf
.na
.Dx
.vs 10p
.\" Revids are defined in ids.mm
.nf
.na
\*[Revids]
.De
.vs
.\" End of preface: make sure we finish on an even page
.ie o .if !\n[pg*head-mark]=\n[nl] \{\
.	bp +1
.\}
.el \{\
.	br
.\}
