New Improved!
Submitted by: Annelise Anderson <andrsn@andrsn.stanford.edu>
This commit is contained in:
parent
933aaa03ac
commit
183ccdcf66
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=1823
3 changed files with 447 additions and 159 deletions
en/tutorials/newuser
en_US.ISO8859-1/articles/new-users
en_US.ISO_8859-1/articles/new-users
|
@ -1,4 +1,4 @@
|
|||
<!-- $Id: newuser.docb,v 1.3 1997-07-01 21:38:45 max Exp $ -->
|
||||
<!-- $Id: newuser.docb,v 1.4 1997-08-15 17:11:49 jfieber Exp $ -->
|
||||
<!-- The FreeBSD Documentation Project -->
|
||||
|
||||
<!DOCTYPE BOOK PUBLIC "-//Davenport//DTD DocBook V3.0//EN">
|
||||
|
@ -13,12 +13,12 @@
|
|||
<firstname>Annelise</firstname>
|
||||
<surname>Anderson</surname>
|
||||
<affiliation>
|
||||
<address><email>andrsn@hoover.stanford.edu</email></address>
|
||||
<address><email>andrsn@andrsn.stanford.edu</email></address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<pubdate>June 30, 1996</pubdate>
|
||||
<pubdate>August 15, 1997</pubdate>
|
||||
|
||||
<abstract><para>Congratulations on installing FreeBSD! This
|
||||
introduction is for people new to both FreeBSD
|
||||
|
@ -39,7 +39,9 @@ class=prompt>login:</systemitem>) as a user you created during
|
|||
installation or as <firstterm>root</firstterm>. (Your FreeBSD
|
||||
installation will already have an account for root; root can go
|
||||
anywhere and do anything, including deleting essential files, so be
|
||||
careful!)</para>
|
||||
careful!) The symbols % and # in the following stand for the prompt
|
||||
(yours may be different), with % indicating an ordinary user and
|
||||
# indicating root. </para>
|
||||
|
||||
<para>To log out (and get a new <systemitem class=prompt>login:</systemitem> prompt) type
|
||||
<informalexample>
|
||||
|
@ -81,8 +83,13 @@ are thus logged in as root, you should probably create a user now with
|
|||
<informalexample>
|
||||
<screen># <userinput>adduser</userinput></screen>
|
||||
</informalexample>
|
||||
Don't use the <option>-verbose</option> option; the defaults are what
|
||||
you want. Suppose you create a user <emphasis>jack</emphasis> with
|
||||
The first time you use adduser, it might ask for some defaults to save. You
|
||||
might want to make the default shell csh instead of sh, if it suggests
|
||||
sh as the default. Otherwise just press enter to accept each default.
|
||||
These defaults are saved in <filename>/etc/adduser.conf</filename>,
|
||||
an editable file.</para>
|
||||
|
||||
<para>Suppose you create a user <emphasis>jack</emphasis> with
|
||||
full name <emphasis>Jack Benimble</emphasis>. Give jack a password
|
||||
if security (even kids around who might pound on the keyboard) is an
|
||||
issue. When it asks you if you want to invite jack into other
|
||||
|
@ -92,8 +99,7 @@ groups, type <userinput>wheel</userinput>
|
|||
</informalexample>
|
||||
This will make it possible to log in as <emphasis>jack</emphasis> and
|
||||
use the <command>su</command> command to become root. Then you won't
|
||||
get scolded any more for logging in as root, and as root you'll have
|
||||
the same environment as jack (this is good).</para>
|
||||
get scolded any more for logging in as root.</para>
|
||||
|
||||
<para>You can quit <command>adduser</command> any time by typing
|
||||
<keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo>, and at
|
||||
|
@ -112,7 +118,11 @@ power—and risk—of root.</para>
|
|||
to <command>su</command> to root, you can log in as root
|
||||
and edit the file <filename>/etc/group</filename>, adding jack to the
|
||||
first line (the group wheel). But first you need to practice
|
||||
<command>vi</command>, the text editor.</para>
|
||||
<command>vi</command>, the text editor--or use the simpler text
|
||||
editor, <command>ee</command>, installed on recent version of
|
||||
FreeBSD.</para>
|
||||
|
||||
<para>To delete a user, use the <command>rmuser</command> command.</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
|
@ -171,8 +181,9 @@ date, permissions.</para>
|
|||
<varlistentry><term><command>ls <option>-a</option></command></term>
|
||||
|
||||
<listitem>
|
||||
<para>Lists hidden (unless you're root) <quote>dot</quote>
|
||||
files with the others.</para>
|
||||
<para>Lists hidden <quote>dot</quote>
|
||||
files with the others. If you're root, the<quote>dot</quote> files
|
||||
show up without the <option>-a</option> switch.</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -284,7 +295,8 @@ is found.</para>
|
|||
|
||||
<listitem>
|
||||
<para>Tells you what the command <replaceable>text</replaceable>
|
||||
does and its man page.</para>
|
||||
does and its man page. Typing <command>whatis *</command> will tell
|
||||
you about all the binaries in the current directory.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -358,33 +370,41 @@ Administration</citetitle> (O'Reilly & Associates, 1993, ISBN
|
|||
|
||||
<para>To configure your system, you need to edit text files. Most of
|
||||
them will be in the <filename>/etc</filename> directory; and you'll
|
||||
need to <command>su</command> to root to be able to change them. The
|
||||
text editor is <command>vi</command>. Before you edit a file, you
|
||||
should probably back it up. Suppose you want to edit
|
||||
<filename>/etc/sysconfig</filename>. You could just use <command>cd
|
||||
need to <command>su</command> to root to be able to change them. You
|
||||
can use the easy <command>ee</command>, but in the long run the
|
||||
text editor <command>vi</command> is worth learning. There's an
|
||||
excellent tutorial on vi in
|
||||
<filename>/usr/src/contrib/nvi/docs/tutorial</filename> if you have
|
||||
that installed; otherwise you can get it by ftp to
|
||||
ftp.cdrom.com in the directory
|
||||
FreeBSD/FreeBSD-current/src/contrib/nvi/docs/tutorial.</para>
|
||||
|
||||
<para>Before you edit a
|
||||
file, you should probably back it up. Suppose you want to edit
|
||||
<filename>/etc/rc.conf</filename>. You could just use <command>cd
|
||||
/etc</command> to get to the <filename>/etc</filename> directory and
|
||||
do:
|
||||
<informalexample>
|
||||
<screen># <userinput>cp sysconfig sysconfig.orig</userinput></screen>
|
||||
<screen># <userinput>cp rc.conf rc.conf.orig</userinput></screen>
|
||||
</informalexample>
|
||||
|
||||
This would copy <filename>sysconfig</filename> to
|
||||
<filename>sysconfig.orig</filename>, and you could later copy
|
||||
<filename>sysconfig.orig</filename> to <emphasis
|
||||
remap=tt>sysconfig</emphasis> to recover the original. But even
|
||||
This would copy <filename>rc.conf</filename> to
|
||||
<filename>rc.conf.orig</filename>, and you could later copy
|
||||
<filename>rc.conf.orig</filename> to <emphasis
|
||||
remap=tt>rc.conf</emphasis> to recover the original. But even
|
||||
better would be moving (renaming) and then copying back:
|
||||
<informalexample>
|
||||
<screen># <userinput>mv sysconfig sysconfig.orig</userinput>
|
||||
# <userinput>cp sysconfig.orig sysconfig</userinput></screen>
|
||||
<screen># <userinput>mv rc.conf rc.conf.orig</userinput>
|
||||
# <userinput>cp rc.conf.orig rc.conf</userinput></screen>
|
||||
</informalexample>
|
||||
|
||||
because the <command>mv</command> command preserves the original date
|
||||
and owner of the file. You can now edit
|
||||
<filename>sysconfig</filename>. If you want the original back, you'd
|
||||
then <userinput>mv sysconfig syconfig.myedit</userinput>
|
||||
<filename>rc.conf</filename>. If you want the original back, you'd
|
||||
then <userinput>mv rc.conf rc.conf.myedit</userinput>
|
||||
(assuming you want to preserve your edited version) and then
|
||||
<informalexample>
|
||||
<screen># <userinput>mv sysconfig.orig sysconfig</userinput></screen>
|
||||
<screen># <userinput>mv rc.conf.orig rc.conf</userinput></screen>
|
||||
</informalexample>
|
||||
to put things back the way they were.</para>
|
||||
|
||||
|
@ -532,9 +552,10 @@ print it from DOS. Suppose you want to read carefully about changing
|
|||
permissions on files (pretty important). You can use the command
|
||||
man chmod to read about it. The command
|
||||
<informalexample>
|
||||
<screen># <userinput>man chmod > chmod.txt</></screen>
|
||||
<screen># <userinput>man chmod | col -b > chmod.txt</></screen>
|
||||
</informalexample>
|
||||
will send the man page to the <filename>chmod.txt</filename> file
|
||||
will remove formatting codes and send the man page to
|
||||
the <filename>chmod.txt</filename> file
|
||||
instead of showing it on your screen. Now put a dos-formatted
|
||||
diskette in your floppy drive a, <command>su</> to
|
||||
root, and type
|
||||
|
@ -574,7 +595,7 @@ out with
|
|||
<screen># <userinput>/sbin/umount /mnt</></screen>
|
||||
</informalexample>
|
||||
and reboot to go to DOS. Copy these files to a DOS directory, call
|
||||
them up with DOS EDIT, Windows Notepad, or a word processor, make a
|
||||
them up with DOS EDIT, Windows Notepad or Wordpad, or a word processor, make a
|
||||
minor change so the file has to be saved, and print as you normally
|
||||
would from DOS or Windows. Hope it works! man pages come out best if
|
||||
printed with the dos <command>print</> command. (Copying files from
|
||||
|
@ -588,9 +609,9 @@ a matching spool directory in
|
|||
<hardware>lpt0</> (what dos calls <hardware>LPT1</>), you may only
|
||||
need to go to <filename>/var/spool/output</filename> and (as root)
|
||||
create the directory <filename>lpd</> by typing:
|
||||
<informalexample>
|
||||
<screen># <userinput>mkdir lpd</></screen>
|
||||
</informalexample>
|
||||
<command>
|
||||
mkdir lpd</command>, if it doesn't already
|
||||
exist.
|
||||
Then the printer should respond if it's turned on when the system is
|
||||
booted, and lp or lpr should send a file to the printer. Whether or
|
||||
not the file actually prints depends on configuring it, which is
|
||||
|
@ -726,11 +747,13 @@ This should result in a <filename>/usr/local/kermit</filename>
|
|||
subdirectory that has all the files that the
|
||||
<command>kermit</command> subdirectory on the CDROM has.</para>
|
||||
|
||||
<para>Next, check <filename>/cdrom/ports/distfiles</filename> for a
|
||||
<para>Next, create the directory <filename>/usr/ports/distfiles</filename>
|
||||
if it doesn't already exist using <command>mkdir</>. Now check
|
||||
check <filename>/cdrom/ports/distfiles</filename> for a
|
||||
file with a name that indicates it's the port you want. Copy that
|
||||
file to <filename>/usr/ports/distfiles</filename>. (Create
|
||||
<filename>/usr/ports/distfiles</filename> if it doesn't exist using
|
||||
<command>mkdir</>.) In the case of <command>kermit</>, there is no
|
||||
file to <filename>/usr/ports/distfiles</filename>; in recent versions
|
||||
you can skip this step, as FreeBSD will do it for you.
|
||||
In the case of <command>kermit</>, there is no
|
||||
distfile.</para>
|
||||
|
||||
<para>Then <command>cd</> to the subdirectory of
|
||||
|
@ -742,8 +765,8 @@ distfile.</para>
|
|||
</para>
|
||||
|
||||
<para>During this process the port will ftp to get any compressed
|
||||
files it needs that it didn't find in
|
||||
<filename>/usr/ports/distfiles</filename>. If you don't have your
|
||||
files it needs that it didn't find on the cdrom or in
|
||||
<filename>/usr/ports/distfiles</filename>. If you don't have your
|
||||
network running yet and there was no file for the port in
|
||||
<filename>/cdrom/ports/distfiles</filename>, you will have to get
|
||||
the distfile using another machine and copy it to
|
||||
|
@ -778,8 +801,8 @@ work; no space after the slash.)</para>
|
|||
|
||||
<para>You might want to get the most recent version of Netscape from
|
||||
their <ulink URL="ftp://ftp.netscape.com">ftp site</ulink>. (Netscape
|
||||
requires the X Window System.) The version you want is the
|
||||
<quote>unknown bsd</quote> version. Just use <command>gunzip
|
||||
requires the X Window System.) There's now a FreeBSD version, so look
|
||||
around carefully. Just use <command>gunzip
|
||||
<replaceable>filename</></> and <command>tar xvf
|
||||
<replaceable>filename</></> on it, move the binary to
|
||||
<filename>/usr/local/bin</filename> or some other place binaries are
|
||||
|
@ -804,32 +827,105 @@ is <filename>/usr/local/lib/netscape/netscape.bin</filename>.</para>
|
|||
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
||||
<title>Your Working Environment</title>
|
||||
|
||||
<para>Your shell is the most important part of your working environment.
|
||||
In DOS, the usual shell is command.com. The shell is what interprets
|
||||
the commands you type on the command line, and thus communicates with
|
||||
the rest of the operating system. You can also write shell
|
||||
scripts, which are like DOS batch files: a series of commands to be
|
||||
run without your intervention.</para>
|
||||
|
||||
<para>Two shells come installed with FreeBSD: csh and sh. csh is good for
|
||||
command-line work, but scripts should be written with sh (or bash). You can
|
||||
find out what shell you have by typing <command>echo $SHELL</command>.</para>
|
||||
|
||||
<para>The csh shell is okay, but tcsh does everything csh does and more. It
|
||||
It allows you to recall commands with the arrow keys and edit them.
|
||||
It has tab-key completion
|
||||
of filenames (csh uses the escape key), and it lets you switch to the
|
||||
directory you were last in with <command>cd -</command>. It's also much
|
||||
easier to alter your prompt with tcsh. It makes life a lot easier.</para>
|
||||
|
||||
<para>Here are the three steps for installing a new shell:</para>
|
||||
|
||||
<para> 1. Install the shell as a port or a package, just as you
|
||||
would any other port or package. Use <command>rehash</command> and
|
||||
<command>which tcsh</command> (assuming you're installing tcsh) to
|
||||
make sure it got installed.</para>
|
||||
|
||||
<para> 2. As root, edit <filename>/etc/shells</filename>, adding
|
||||
a line in the file for the new shell, in this case /usr/local/bin/tcsh,
|
||||
and save the file. (Some ports may do this for you.)</para>
|
||||
|
||||
<para> 3. Use the <command>chsh</command> command to change your shell to
|
||||
tcsh permanently, or type <command>tcsh</command> at the prompt to
|
||||
change your shell without logging in again.</para>
|
||||
|
||||
<para><emphasis>Note: It can be dangerous to change root's shell</emphasis>
|
||||
to something other than sh or csh on early versions of FreeBSD and many
|
||||
other versions of Unix; you may not have a working shell when the system
|
||||
puts you into single user mode. The solution is to use <command>su -m</command>
|
||||
to become root, which will give you the tcsh as root, because the shell is part
|
||||
of the environment. You can make this permanent by adding it to your
|
||||
<filename>.tcshrc</filename> file as an alias with <programlisting>alias su su -m.</></para>
|
||||
|
||||
<para>When tcsh starts up, it will read the
|
||||
<filename>/etc/csh.cshrc</filename> and <filename>/etc/csh.login</filename>
|
||||
files, as does csh. It will also read the
|
||||
<filename>.login</filename> file in your home directory and the
|
||||
<filename>.cshrc</filename>
|
||||
file as well, unless you provide a <filename>.tcshrc</filename>
|
||||
file. This you can do by simply copying <filename>.cshrc</filename>
|
||||
to <filename>.tcshrc</filename>.</para>
|
||||
|
||||
<para>Now that you've installed tcsh, you can adjust your prompt. You can
|
||||
find the details in the manual page for tcsh, but here is a line to
|
||||
put in your <filename>.tcshrc</filename> that will tell you how many
|
||||
commands you have typed, what time it is, and what directory you are in.
|
||||
It also produces a <literal>></literal> if you're an ordinary user and
|
||||
a <literal>#</literal> if you're root, but tsch will do that in any
|
||||
case:</para>
|
||||
<para>
|
||||
set prompt = "%h %t %~ %# "</para>
|
||||
|
||||
<para>This should go in the same place as the existing set prompt line
|
||||
if there is one, or under "if($?prompt) then" if not.
|
||||
Comment out the old line; you can always switch back to it if you prefer
|
||||
it. Don't forget the spaces and quotes. You can get the <filename>.tcshrc</filename> reread by typing <command>source .tcshrc</command>.</para>
|
||||
|
||||
<para>You can get a listing of other environmental variables that
|
||||
have been set by typing <command>env</command> at the prompt. The
|
||||
result will show you your default editor, pager, and terminal type,
|
||||
among possibly many others. A useful command if you log in from a
|
||||
remote location and can't run a program because the terminal isn't
|
||||
capable is
|
||||
<command>setenv TERM vt100</command>.</para>
|
||||
</chapter>
|
||||
|
||||
|
||||
<chapter>
|
||||
<title>Other</title>
|
||||
|
||||
<para>As root, you can dismount the CDROM with <command>/sbin/umount
|
||||
/cdrom</>, take it out of the drive, insert another one, and mount it
|
||||
with <command>/sbin/mount_cd9660 /dev/cd0a /cdrom</> assuming
|
||||
<hardware>cd0a</> is the device name for your CDROM drive.</para>
|
||||
<hardware>cd0a</> is the device name for your CDROM drive. The
|
||||
most recent versions of FreeBSD let you mount the cdrom with just
|
||||
<command>/sbin/mount /cdrom</command>.</para>
|
||||
|
||||
<para>Using the live file system—the second of FreeBSD's CDROM
|
||||
disks—is useful if you've got limited space. You might try
|
||||
using <command>emacs</> or playing games from the cdrom. This
|
||||
disks—is useful if you've got limited space. What is on the
|
||||
live file system varies from release to release. You might try
|
||||
playing games from the cdrom. This
|
||||
involves using <command>lndir</>, which gets installed with the X
|
||||
Window System, to tell the program(s) where to find the necessary
|
||||
files, because they're in the <filename>/cdrom</filename> file system
|
||||
instead of in <filename>/usr</filename> and its subdirectories, which
|
||||
is where they're expected to be. Read <command>man lndir</>.</para>
|
||||
|
||||
<para>You can delete a user (say, jack) by using the command
|
||||
<command>vipw</> to bring up the <filename>master.passwd</filename>
|
||||
file (do not use <command>vi</> directly on master.passwd); delete
|
||||
the line for jack and save the file. Then edit
|
||||
<filename>/etc/group</filename>, eliminating jack wherever it
|
||||
appears. Finally, go to <filename>/usr/home</filename> and use
|
||||
<command>rm -R</command> jack (to get rid of user jack's home
|
||||
directory files).</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
@ -841,7 +937,7 @@ if it was helpful. My thanks to Eugene W. Stark, professor of
|
|||
computer science at SUNY-Stony Brook, and John Fieber for helpful
|
||||
comments.</para>
|
||||
|
||||
<para>Annelise Anderson, <email>andrsn@hoover.stanford.edu</></para>
|
||||
<para>Annelise Anderson, <email>andrsn@andrsn.stanford.edu</></para>
|
||||
|
||||
</chapter>
|
||||
</book>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- $Id: article.sgml,v 1.3 1997-07-01 21:38:45 max Exp $ -->
|
||||
<!-- $Id: article.sgml,v 1.4 1997-08-15 17:11:49 jfieber Exp $ -->
|
||||
<!-- The FreeBSD Documentation Project -->
|
||||
|
||||
<!DOCTYPE BOOK PUBLIC "-//Davenport//DTD DocBook V3.0//EN">
|
||||
|
@ -13,12 +13,12 @@
|
|||
<firstname>Annelise</firstname>
|
||||
<surname>Anderson</surname>
|
||||
<affiliation>
|
||||
<address><email>andrsn@hoover.stanford.edu</email></address>
|
||||
<address><email>andrsn@andrsn.stanford.edu</email></address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<pubdate>June 30, 1996</pubdate>
|
||||
<pubdate>August 15, 1997</pubdate>
|
||||
|
||||
<abstract><para>Congratulations on installing FreeBSD! This
|
||||
introduction is for people new to both FreeBSD
|
||||
|
@ -39,7 +39,9 @@ class=prompt>login:</systemitem>) as a user you created during
|
|||
installation or as <firstterm>root</firstterm>. (Your FreeBSD
|
||||
installation will already have an account for root; root can go
|
||||
anywhere and do anything, including deleting essential files, so be
|
||||
careful!)</para>
|
||||
careful!) The symbols % and # in the following stand for the prompt
|
||||
(yours may be different), with % indicating an ordinary user and
|
||||
# indicating root. </para>
|
||||
|
||||
<para>To log out (and get a new <systemitem class=prompt>login:</systemitem> prompt) type
|
||||
<informalexample>
|
||||
|
@ -81,8 +83,13 @@ are thus logged in as root, you should probably create a user now with
|
|||
<informalexample>
|
||||
<screen># <userinput>adduser</userinput></screen>
|
||||
</informalexample>
|
||||
Don't use the <option>-verbose</option> option; the defaults are what
|
||||
you want. Suppose you create a user <emphasis>jack</emphasis> with
|
||||
The first time you use adduser, it might ask for some defaults to save. You
|
||||
might want to make the default shell csh instead of sh, if it suggests
|
||||
sh as the default. Otherwise just press enter to accept each default.
|
||||
These defaults are saved in <filename>/etc/adduser.conf</filename>,
|
||||
an editable file.</para>
|
||||
|
||||
<para>Suppose you create a user <emphasis>jack</emphasis> with
|
||||
full name <emphasis>Jack Benimble</emphasis>. Give jack a password
|
||||
if security (even kids around who might pound on the keyboard) is an
|
||||
issue. When it asks you if you want to invite jack into other
|
||||
|
@ -92,8 +99,7 @@ groups, type <userinput>wheel</userinput>
|
|||
</informalexample>
|
||||
This will make it possible to log in as <emphasis>jack</emphasis> and
|
||||
use the <command>su</command> command to become root. Then you won't
|
||||
get scolded any more for logging in as root, and as root you'll have
|
||||
the same environment as jack (this is good).</para>
|
||||
get scolded any more for logging in as root.</para>
|
||||
|
||||
<para>You can quit <command>adduser</command> any time by typing
|
||||
<keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo>, and at
|
||||
|
@ -112,7 +118,11 @@ power—and risk—of root.</para>
|
|||
to <command>su</command> to root, you can log in as root
|
||||
and edit the file <filename>/etc/group</filename>, adding jack to the
|
||||
first line (the group wheel). But first you need to practice
|
||||
<command>vi</command>, the text editor.</para>
|
||||
<command>vi</command>, the text editor--or use the simpler text
|
||||
editor, <command>ee</command>, installed on recent version of
|
||||
FreeBSD.</para>
|
||||
|
||||
<para>To delete a user, use the <command>rmuser</command> command.</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
|
@ -171,8 +181,9 @@ date, permissions.</para>
|
|||
<varlistentry><term><command>ls <option>-a</option></command></term>
|
||||
|
||||
<listitem>
|
||||
<para>Lists hidden (unless you're root) <quote>dot</quote>
|
||||
files with the others.</para>
|
||||
<para>Lists hidden <quote>dot</quote>
|
||||
files with the others. If you're root, the<quote>dot</quote> files
|
||||
show up without the <option>-a</option> switch.</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -284,7 +295,8 @@ is found.</para>
|
|||
|
||||
<listitem>
|
||||
<para>Tells you what the command <replaceable>text</replaceable>
|
||||
does and its man page.</para>
|
||||
does and its man page. Typing <command>whatis *</command> will tell
|
||||
you about all the binaries in the current directory.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -358,33 +370,41 @@ Administration</citetitle> (O'Reilly & Associates, 1993, ISBN
|
|||
|
||||
<para>To configure your system, you need to edit text files. Most of
|
||||
them will be in the <filename>/etc</filename> directory; and you'll
|
||||
need to <command>su</command> to root to be able to change them. The
|
||||
text editor is <command>vi</command>. Before you edit a file, you
|
||||
should probably back it up. Suppose you want to edit
|
||||
<filename>/etc/sysconfig</filename>. You could just use <command>cd
|
||||
need to <command>su</command> to root to be able to change them. You
|
||||
can use the easy <command>ee</command>, but in the long run the
|
||||
text editor <command>vi</command> is worth learning. There's an
|
||||
excellent tutorial on vi in
|
||||
<filename>/usr/src/contrib/nvi/docs/tutorial</filename> if you have
|
||||
that installed; otherwise you can get it by ftp to
|
||||
ftp.cdrom.com in the directory
|
||||
FreeBSD/FreeBSD-current/src/contrib/nvi/docs/tutorial.</para>
|
||||
|
||||
<para>Before you edit a
|
||||
file, you should probably back it up. Suppose you want to edit
|
||||
<filename>/etc/rc.conf</filename>. You could just use <command>cd
|
||||
/etc</command> to get to the <filename>/etc</filename> directory and
|
||||
do:
|
||||
<informalexample>
|
||||
<screen># <userinput>cp sysconfig sysconfig.orig</userinput></screen>
|
||||
<screen># <userinput>cp rc.conf rc.conf.orig</userinput></screen>
|
||||
</informalexample>
|
||||
|
||||
This would copy <filename>sysconfig</filename> to
|
||||
<filename>sysconfig.orig</filename>, and you could later copy
|
||||
<filename>sysconfig.orig</filename> to <emphasis
|
||||
remap=tt>sysconfig</emphasis> to recover the original. But even
|
||||
This would copy <filename>rc.conf</filename> to
|
||||
<filename>rc.conf.orig</filename>, and you could later copy
|
||||
<filename>rc.conf.orig</filename> to <emphasis
|
||||
remap=tt>rc.conf</emphasis> to recover the original. But even
|
||||
better would be moving (renaming) and then copying back:
|
||||
<informalexample>
|
||||
<screen># <userinput>mv sysconfig sysconfig.orig</userinput>
|
||||
# <userinput>cp sysconfig.orig sysconfig</userinput></screen>
|
||||
<screen># <userinput>mv rc.conf rc.conf.orig</userinput>
|
||||
# <userinput>cp rc.conf.orig rc.conf</userinput></screen>
|
||||
</informalexample>
|
||||
|
||||
because the <command>mv</command> command preserves the original date
|
||||
and owner of the file. You can now edit
|
||||
<filename>sysconfig</filename>. If you want the original back, you'd
|
||||
then <userinput>mv sysconfig syconfig.myedit</userinput>
|
||||
<filename>rc.conf</filename>. If you want the original back, you'd
|
||||
then <userinput>mv rc.conf rc.conf.myedit</userinput>
|
||||
(assuming you want to preserve your edited version) and then
|
||||
<informalexample>
|
||||
<screen># <userinput>mv sysconfig.orig sysconfig</userinput></screen>
|
||||
<screen># <userinput>mv rc.conf.orig rc.conf</userinput></screen>
|
||||
</informalexample>
|
||||
to put things back the way they were.</para>
|
||||
|
||||
|
@ -532,9 +552,10 @@ print it from DOS. Suppose you want to read carefully about changing
|
|||
permissions on files (pretty important). You can use the command
|
||||
man chmod to read about it. The command
|
||||
<informalexample>
|
||||
<screen># <userinput>man chmod > chmod.txt</></screen>
|
||||
<screen># <userinput>man chmod | col -b > chmod.txt</></screen>
|
||||
</informalexample>
|
||||
will send the man page to the <filename>chmod.txt</filename> file
|
||||
will remove formatting codes and send the man page to
|
||||
the <filename>chmod.txt</filename> file
|
||||
instead of showing it on your screen. Now put a dos-formatted
|
||||
diskette in your floppy drive a, <command>su</> to
|
||||
root, and type
|
||||
|
@ -574,7 +595,7 @@ out with
|
|||
<screen># <userinput>/sbin/umount /mnt</></screen>
|
||||
</informalexample>
|
||||
and reboot to go to DOS. Copy these files to a DOS directory, call
|
||||
them up with DOS EDIT, Windows Notepad, or a word processor, make a
|
||||
them up with DOS EDIT, Windows Notepad or Wordpad, or a word processor, make a
|
||||
minor change so the file has to be saved, and print as you normally
|
||||
would from DOS or Windows. Hope it works! man pages come out best if
|
||||
printed with the dos <command>print</> command. (Copying files from
|
||||
|
@ -588,9 +609,9 @@ a matching spool directory in
|
|||
<hardware>lpt0</> (what dos calls <hardware>LPT1</>), you may only
|
||||
need to go to <filename>/var/spool/output</filename> and (as root)
|
||||
create the directory <filename>lpd</> by typing:
|
||||
<informalexample>
|
||||
<screen># <userinput>mkdir lpd</></screen>
|
||||
</informalexample>
|
||||
<command>
|
||||
mkdir lpd</command>, if it doesn't already
|
||||
exist.
|
||||
Then the printer should respond if it's turned on when the system is
|
||||
booted, and lp or lpr should send a file to the printer. Whether or
|
||||
not the file actually prints depends on configuring it, which is
|
||||
|
@ -726,11 +747,13 @@ This should result in a <filename>/usr/local/kermit</filename>
|
|||
subdirectory that has all the files that the
|
||||
<command>kermit</command> subdirectory on the CDROM has.</para>
|
||||
|
||||
<para>Next, check <filename>/cdrom/ports/distfiles</filename> for a
|
||||
<para>Next, create the directory <filename>/usr/ports/distfiles</filename>
|
||||
if it doesn't already exist using <command>mkdir</>. Now check
|
||||
check <filename>/cdrom/ports/distfiles</filename> for a
|
||||
file with a name that indicates it's the port you want. Copy that
|
||||
file to <filename>/usr/ports/distfiles</filename>. (Create
|
||||
<filename>/usr/ports/distfiles</filename> if it doesn't exist using
|
||||
<command>mkdir</>.) In the case of <command>kermit</>, there is no
|
||||
file to <filename>/usr/ports/distfiles</filename>; in recent versions
|
||||
you can skip this step, as FreeBSD will do it for you.
|
||||
In the case of <command>kermit</>, there is no
|
||||
distfile.</para>
|
||||
|
||||
<para>Then <command>cd</> to the subdirectory of
|
||||
|
@ -742,8 +765,8 @@ distfile.</para>
|
|||
</para>
|
||||
|
||||
<para>During this process the port will ftp to get any compressed
|
||||
files it needs that it didn't find in
|
||||
<filename>/usr/ports/distfiles</filename>. If you don't have your
|
||||
files it needs that it didn't find on the cdrom or in
|
||||
<filename>/usr/ports/distfiles</filename>. If you don't have your
|
||||
network running yet and there was no file for the port in
|
||||
<filename>/cdrom/ports/distfiles</filename>, you will have to get
|
||||
the distfile using another machine and copy it to
|
||||
|
@ -778,8 +801,8 @@ work; no space after the slash.)</para>
|
|||
|
||||
<para>You might want to get the most recent version of Netscape from
|
||||
their <ulink URL="ftp://ftp.netscape.com">ftp site</ulink>. (Netscape
|
||||
requires the X Window System.) The version you want is the
|
||||
<quote>unknown bsd</quote> version. Just use <command>gunzip
|
||||
requires the X Window System.) There's now a FreeBSD version, so look
|
||||
around carefully. Just use <command>gunzip
|
||||
<replaceable>filename</></> and <command>tar xvf
|
||||
<replaceable>filename</></> on it, move the binary to
|
||||
<filename>/usr/local/bin</filename> or some other place binaries are
|
||||
|
@ -804,32 +827,105 @@ is <filename>/usr/local/lib/netscape/netscape.bin</filename>.</para>
|
|||
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
||||
<title>Your Working Environment</title>
|
||||
|
||||
<para>Your shell is the most important part of your working environment.
|
||||
In DOS, the usual shell is command.com. The shell is what interprets
|
||||
the commands you type on the command line, and thus communicates with
|
||||
the rest of the operating system. You can also write shell
|
||||
scripts, which are like DOS batch files: a series of commands to be
|
||||
run without your intervention.</para>
|
||||
|
||||
<para>Two shells come installed with FreeBSD: csh and sh. csh is good for
|
||||
command-line work, but scripts should be written with sh (or bash). You can
|
||||
find out what shell you have by typing <command>echo $SHELL</command>.</para>
|
||||
|
||||
<para>The csh shell is okay, but tcsh does everything csh does and more. It
|
||||
It allows you to recall commands with the arrow keys and edit them.
|
||||
It has tab-key completion
|
||||
of filenames (csh uses the escape key), and it lets you switch to the
|
||||
directory you were last in with <command>cd -</command>. It's also much
|
||||
easier to alter your prompt with tcsh. It makes life a lot easier.</para>
|
||||
|
||||
<para>Here are the three steps for installing a new shell:</para>
|
||||
|
||||
<para> 1. Install the shell as a port or a package, just as you
|
||||
would any other port or package. Use <command>rehash</command> and
|
||||
<command>which tcsh</command> (assuming you're installing tcsh) to
|
||||
make sure it got installed.</para>
|
||||
|
||||
<para> 2. As root, edit <filename>/etc/shells</filename>, adding
|
||||
a line in the file for the new shell, in this case /usr/local/bin/tcsh,
|
||||
and save the file. (Some ports may do this for you.)</para>
|
||||
|
||||
<para> 3. Use the <command>chsh</command> command to change your shell to
|
||||
tcsh permanently, or type <command>tcsh</command> at the prompt to
|
||||
change your shell without logging in again.</para>
|
||||
|
||||
<para><emphasis>Note: It can be dangerous to change root's shell</emphasis>
|
||||
to something other than sh or csh on early versions of FreeBSD and many
|
||||
other versions of Unix; you may not have a working shell when the system
|
||||
puts you into single user mode. The solution is to use <command>su -m</command>
|
||||
to become root, which will give you the tcsh as root, because the shell is part
|
||||
of the environment. You can make this permanent by adding it to your
|
||||
<filename>.tcshrc</filename> file as an alias with <programlisting>alias su su -m.</></para>
|
||||
|
||||
<para>When tcsh starts up, it will read the
|
||||
<filename>/etc/csh.cshrc</filename> and <filename>/etc/csh.login</filename>
|
||||
files, as does csh. It will also read the
|
||||
<filename>.login</filename> file in your home directory and the
|
||||
<filename>.cshrc</filename>
|
||||
file as well, unless you provide a <filename>.tcshrc</filename>
|
||||
file. This you can do by simply copying <filename>.cshrc</filename>
|
||||
to <filename>.tcshrc</filename>.</para>
|
||||
|
||||
<para>Now that you've installed tcsh, you can adjust your prompt. You can
|
||||
find the details in the manual page for tcsh, but here is a line to
|
||||
put in your <filename>.tcshrc</filename> that will tell you how many
|
||||
commands you have typed, what time it is, and what directory you are in.
|
||||
It also produces a <literal>></literal> if you're an ordinary user and
|
||||
a <literal>#</literal> if you're root, but tsch will do that in any
|
||||
case:</para>
|
||||
<para>
|
||||
set prompt = "%h %t %~ %# "</para>
|
||||
|
||||
<para>This should go in the same place as the existing set prompt line
|
||||
if there is one, or under "if($?prompt) then" if not.
|
||||
Comment out the old line; you can always switch back to it if you prefer
|
||||
it. Don't forget the spaces and quotes. You can get the <filename>.tcshrc</filename> reread by typing <command>source .tcshrc</command>.</para>
|
||||
|
||||
<para>You can get a listing of other environmental variables that
|
||||
have been set by typing <command>env</command> at the prompt. The
|
||||
result will show you your default editor, pager, and terminal type,
|
||||
among possibly many others. A useful command if you log in from a
|
||||
remote location and can't run a program because the terminal isn't
|
||||
capable is
|
||||
<command>setenv TERM vt100</command>.</para>
|
||||
</chapter>
|
||||
|
||||
|
||||
<chapter>
|
||||
<title>Other</title>
|
||||
|
||||
<para>As root, you can dismount the CDROM with <command>/sbin/umount
|
||||
/cdrom</>, take it out of the drive, insert another one, and mount it
|
||||
with <command>/sbin/mount_cd9660 /dev/cd0a /cdrom</> assuming
|
||||
<hardware>cd0a</> is the device name for your CDROM drive.</para>
|
||||
<hardware>cd0a</> is the device name for your CDROM drive. The
|
||||
most recent versions of FreeBSD let you mount the cdrom with just
|
||||
<command>/sbin/mount /cdrom</command>.</para>
|
||||
|
||||
<para>Using the live file system—the second of FreeBSD's CDROM
|
||||
disks—is useful if you've got limited space. You might try
|
||||
using <command>emacs</> or playing games from the cdrom. This
|
||||
disks—is useful if you've got limited space. What is on the
|
||||
live file system varies from release to release. You might try
|
||||
playing games from the cdrom. This
|
||||
involves using <command>lndir</>, which gets installed with the X
|
||||
Window System, to tell the program(s) where to find the necessary
|
||||
files, because they're in the <filename>/cdrom</filename> file system
|
||||
instead of in <filename>/usr</filename> and its subdirectories, which
|
||||
is where they're expected to be. Read <command>man lndir</>.</para>
|
||||
|
||||
<para>You can delete a user (say, jack) by using the command
|
||||
<command>vipw</> to bring up the <filename>master.passwd</filename>
|
||||
file (do not use <command>vi</> directly on master.passwd); delete
|
||||
the line for jack and save the file. Then edit
|
||||
<filename>/etc/group</filename>, eliminating jack wherever it
|
||||
appears. Finally, go to <filename>/usr/home</filename> and use
|
||||
<command>rm -R</command> jack (to get rid of user jack's home
|
||||
directory files).</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
@ -841,7 +937,7 @@ if it was helpful. My thanks to Eugene W. Stark, professor of
|
|||
computer science at SUNY-Stony Brook, and John Fieber for helpful
|
||||
comments.</para>
|
||||
|
||||
<para>Annelise Anderson, <email>andrsn@hoover.stanford.edu</></para>
|
||||
<para>Annelise Anderson, <email>andrsn@andrsn.stanford.edu</></para>
|
||||
|
||||
</chapter>
|
||||
</book>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- $Id: article.sgml,v 1.3 1997-07-01 21:38:45 max Exp $ -->
|
||||
<!-- $Id: article.sgml,v 1.4 1997-08-15 17:11:49 jfieber Exp $ -->
|
||||
<!-- The FreeBSD Documentation Project -->
|
||||
|
||||
<!DOCTYPE BOOK PUBLIC "-//Davenport//DTD DocBook V3.0//EN">
|
||||
|
@ -13,12 +13,12 @@
|
|||
<firstname>Annelise</firstname>
|
||||
<surname>Anderson</surname>
|
||||
<affiliation>
|
||||
<address><email>andrsn@hoover.stanford.edu</email></address>
|
||||
<address><email>andrsn@andrsn.stanford.edu</email></address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<pubdate>June 30, 1996</pubdate>
|
||||
<pubdate>August 15, 1997</pubdate>
|
||||
|
||||
<abstract><para>Congratulations on installing FreeBSD! This
|
||||
introduction is for people new to both FreeBSD
|
||||
|
@ -39,7 +39,9 @@ class=prompt>login:</systemitem>) as a user you created during
|
|||
installation or as <firstterm>root</firstterm>. (Your FreeBSD
|
||||
installation will already have an account for root; root can go
|
||||
anywhere and do anything, including deleting essential files, so be
|
||||
careful!)</para>
|
||||
careful!) The symbols % and # in the following stand for the prompt
|
||||
(yours may be different), with % indicating an ordinary user and
|
||||
# indicating root. </para>
|
||||
|
||||
<para>To log out (and get a new <systemitem class=prompt>login:</systemitem> prompt) type
|
||||
<informalexample>
|
||||
|
@ -81,8 +83,13 @@ are thus logged in as root, you should probably create a user now with
|
|||
<informalexample>
|
||||
<screen># <userinput>adduser</userinput></screen>
|
||||
</informalexample>
|
||||
Don't use the <option>-verbose</option> option; the defaults are what
|
||||
you want. Suppose you create a user <emphasis>jack</emphasis> with
|
||||
The first time you use adduser, it might ask for some defaults to save. You
|
||||
might want to make the default shell csh instead of sh, if it suggests
|
||||
sh as the default. Otherwise just press enter to accept each default.
|
||||
These defaults are saved in <filename>/etc/adduser.conf</filename>,
|
||||
an editable file.</para>
|
||||
|
||||
<para>Suppose you create a user <emphasis>jack</emphasis> with
|
||||
full name <emphasis>Jack Benimble</emphasis>. Give jack a password
|
||||
if security (even kids around who might pound on the keyboard) is an
|
||||
issue. When it asks you if you want to invite jack into other
|
||||
|
@ -92,8 +99,7 @@ groups, type <userinput>wheel</userinput>
|
|||
</informalexample>
|
||||
This will make it possible to log in as <emphasis>jack</emphasis> and
|
||||
use the <command>su</command> command to become root. Then you won't
|
||||
get scolded any more for logging in as root, and as root you'll have
|
||||
the same environment as jack (this is good).</para>
|
||||
get scolded any more for logging in as root.</para>
|
||||
|
||||
<para>You can quit <command>adduser</command> any time by typing
|
||||
<keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo>, and at
|
||||
|
@ -112,7 +118,11 @@ power—and risk—of root.</para>
|
|||
to <command>su</command> to root, you can log in as root
|
||||
and edit the file <filename>/etc/group</filename>, adding jack to the
|
||||
first line (the group wheel). But first you need to practice
|
||||
<command>vi</command>, the text editor.</para>
|
||||
<command>vi</command>, the text editor--or use the simpler text
|
||||
editor, <command>ee</command>, installed on recent version of
|
||||
FreeBSD.</para>
|
||||
|
||||
<para>To delete a user, use the <command>rmuser</command> command.</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
|
@ -171,8 +181,9 @@ date, permissions.</para>
|
|||
<varlistentry><term><command>ls <option>-a</option></command></term>
|
||||
|
||||
<listitem>
|
||||
<para>Lists hidden (unless you're root) <quote>dot</quote>
|
||||
files with the others.</para>
|
||||
<para>Lists hidden <quote>dot</quote>
|
||||
files with the others. If you're root, the<quote>dot</quote> files
|
||||
show up without the <option>-a</option> switch.</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -284,7 +295,8 @@ is found.</para>
|
|||
|
||||
<listitem>
|
||||
<para>Tells you what the command <replaceable>text</replaceable>
|
||||
does and its man page.</para>
|
||||
does and its man page. Typing <command>whatis *</command> will tell
|
||||
you about all the binaries in the current directory.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -358,33 +370,41 @@ Administration</citetitle> (O'Reilly & Associates, 1993, ISBN
|
|||
|
||||
<para>To configure your system, you need to edit text files. Most of
|
||||
them will be in the <filename>/etc</filename> directory; and you'll
|
||||
need to <command>su</command> to root to be able to change them. The
|
||||
text editor is <command>vi</command>. Before you edit a file, you
|
||||
should probably back it up. Suppose you want to edit
|
||||
<filename>/etc/sysconfig</filename>. You could just use <command>cd
|
||||
need to <command>su</command> to root to be able to change them. You
|
||||
can use the easy <command>ee</command>, but in the long run the
|
||||
text editor <command>vi</command> is worth learning. There's an
|
||||
excellent tutorial on vi in
|
||||
<filename>/usr/src/contrib/nvi/docs/tutorial</filename> if you have
|
||||
that installed; otherwise you can get it by ftp to
|
||||
ftp.cdrom.com in the directory
|
||||
FreeBSD/FreeBSD-current/src/contrib/nvi/docs/tutorial.</para>
|
||||
|
||||
<para>Before you edit a
|
||||
file, you should probably back it up. Suppose you want to edit
|
||||
<filename>/etc/rc.conf</filename>. You could just use <command>cd
|
||||
/etc</command> to get to the <filename>/etc</filename> directory and
|
||||
do:
|
||||
<informalexample>
|
||||
<screen># <userinput>cp sysconfig sysconfig.orig</userinput></screen>
|
||||
<screen># <userinput>cp rc.conf rc.conf.orig</userinput></screen>
|
||||
</informalexample>
|
||||
|
||||
This would copy <filename>sysconfig</filename> to
|
||||
<filename>sysconfig.orig</filename>, and you could later copy
|
||||
<filename>sysconfig.orig</filename> to <emphasis
|
||||
remap=tt>sysconfig</emphasis> to recover the original. But even
|
||||
This would copy <filename>rc.conf</filename> to
|
||||
<filename>rc.conf.orig</filename>, and you could later copy
|
||||
<filename>rc.conf.orig</filename> to <emphasis
|
||||
remap=tt>rc.conf</emphasis> to recover the original. But even
|
||||
better would be moving (renaming) and then copying back:
|
||||
<informalexample>
|
||||
<screen># <userinput>mv sysconfig sysconfig.orig</userinput>
|
||||
# <userinput>cp sysconfig.orig sysconfig</userinput></screen>
|
||||
<screen># <userinput>mv rc.conf rc.conf.orig</userinput>
|
||||
# <userinput>cp rc.conf.orig rc.conf</userinput></screen>
|
||||
</informalexample>
|
||||
|
||||
because the <command>mv</command> command preserves the original date
|
||||
and owner of the file. You can now edit
|
||||
<filename>sysconfig</filename>. If you want the original back, you'd
|
||||
then <userinput>mv sysconfig syconfig.myedit</userinput>
|
||||
<filename>rc.conf</filename>. If you want the original back, you'd
|
||||
then <userinput>mv rc.conf rc.conf.myedit</userinput>
|
||||
(assuming you want to preserve your edited version) and then
|
||||
<informalexample>
|
||||
<screen># <userinput>mv sysconfig.orig sysconfig</userinput></screen>
|
||||
<screen># <userinput>mv rc.conf.orig rc.conf</userinput></screen>
|
||||
</informalexample>
|
||||
to put things back the way they were.</para>
|
||||
|
||||
|
@ -532,9 +552,10 @@ print it from DOS. Suppose you want to read carefully about changing
|
|||
permissions on files (pretty important). You can use the command
|
||||
man chmod to read about it. The command
|
||||
<informalexample>
|
||||
<screen># <userinput>man chmod > chmod.txt</></screen>
|
||||
<screen># <userinput>man chmod | col -b > chmod.txt</></screen>
|
||||
</informalexample>
|
||||
will send the man page to the <filename>chmod.txt</filename> file
|
||||
will remove formatting codes and send the man page to
|
||||
the <filename>chmod.txt</filename> file
|
||||
instead of showing it on your screen. Now put a dos-formatted
|
||||
diskette in your floppy drive a, <command>su</> to
|
||||
root, and type
|
||||
|
@ -574,7 +595,7 @@ out with
|
|||
<screen># <userinput>/sbin/umount /mnt</></screen>
|
||||
</informalexample>
|
||||
and reboot to go to DOS. Copy these files to a DOS directory, call
|
||||
them up with DOS EDIT, Windows Notepad, or a word processor, make a
|
||||
them up with DOS EDIT, Windows Notepad or Wordpad, or a word processor, make a
|
||||
minor change so the file has to be saved, and print as you normally
|
||||
would from DOS or Windows. Hope it works! man pages come out best if
|
||||
printed with the dos <command>print</> command. (Copying files from
|
||||
|
@ -588,9 +609,9 @@ a matching spool directory in
|
|||
<hardware>lpt0</> (what dos calls <hardware>LPT1</>), you may only
|
||||
need to go to <filename>/var/spool/output</filename> and (as root)
|
||||
create the directory <filename>lpd</> by typing:
|
||||
<informalexample>
|
||||
<screen># <userinput>mkdir lpd</></screen>
|
||||
</informalexample>
|
||||
<command>
|
||||
mkdir lpd</command>, if it doesn't already
|
||||
exist.
|
||||
Then the printer should respond if it's turned on when the system is
|
||||
booted, and lp or lpr should send a file to the printer. Whether or
|
||||
not the file actually prints depends on configuring it, which is
|
||||
|
@ -726,11 +747,13 @@ This should result in a <filename>/usr/local/kermit</filename>
|
|||
subdirectory that has all the files that the
|
||||
<command>kermit</command> subdirectory on the CDROM has.</para>
|
||||
|
||||
<para>Next, check <filename>/cdrom/ports/distfiles</filename> for a
|
||||
<para>Next, create the directory <filename>/usr/ports/distfiles</filename>
|
||||
if it doesn't already exist using <command>mkdir</>. Now check
|
||||
check <filename>/cdrom/ports/distfiles</filename> for a
|
||||
file with a name that indicates it's the port you want. Copy that
|
||||
file to <filename>/usr/ports/distfiles</filename>. (Create
|
||||
<filename>/usr/ports/distfiles</filename> if it doesn't exist using
|
||||
<command>mkdir</>.) In the case of <command>kermit</>, there is no
|
||||
file to <filename>/usr/ports/distfiles</filename>; in recent versions
|
||||
you can skip this step, as FreeBSD will do it for you.
|
||||
In the case of <command>kermit</>, there is no
|
||||
distfile.</para>
|
||||
|
||||
<para>Then <command>cd</> to the subdirectory of
|
||||
|
@ -742,8 +765,8 @@ distfile.</para>
|
|||
</para>
|
||||
|
||||
<para>During this process the port will ftp to get any compressed
|
||||
files it needs that it didn't find in
|
||||
<filename>/usr/ports/distfiles</filename>. If you don't have your
|
||||
files it needs that it didn't find on the cdrom or in
|
||||
<filename>/usr/ports/distfiles</filename>. If you don't have your
|
||||
network running yet and there was no file for the port in
|
||||
<filename>/cdrom/ports/distfiles</filename>, you will have to get
|
||||
the distfile using another machine and copy it to
|
||||
|
@ -778,8 +801,8 @@ work; no space after the slash.)</para>
|
|||
|
||||
<para>You might want to get the most recent version of Netscape from
|
||||
their <ulink URL="ftp://ftp.netscape.com">ftp site</ulink>. (Netscape
|
||||
requires the X Window System.) The version you want is the
|
||||
<quote>unknown bsd</quote> version. Just use <command>gunzip
|
||||
requires the X Window System.) There's now a FreeBSD version, so look
|
||||
around carefully. Just use <command>gunzip
|
||||
<replaceable>filename</></> and <command>tar xvf
|
||||
<replaceable>filename</></> on it, move the binary to
|
||||
<filename>/usr/local/bin</filename> or some other place binaries are
|
||||
|
@ -804,32 +827,105 @@ is <filename>/usr/local/lib/netscape/netscape.bin</filename>.</para>
|
|||
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
||||
<title>Your Working Environment</title>
|
||||
|
||||
<para>Your shell is the most important part of your working environment.
|
||||
In DOS, the usual shell is command.com. The shell is what interprets
|
||||
the commands you type on the command line, and thus communicates with
|
||||
the rest of the operating system. You can also write shell
|
||||
scripts, which are like DOS batch files: a series of commands to be
|
||||
run without your intervention.</para>
|
||||
|
||||
<para>Two shells come installed with FreeBSD: csh and sh. csh is good for
|
||||
command-line work, but scripts should be written with sh (or bash). You can
|
||||
find out what shell you have by typing <command>echo $SHELL</command>.</para>
|
||||
|
||||
<para>The csh shell is okay, but tcsh does everything csh does and more. It
|
||||
It allows you to recall commands with the arrow keys and edit them.
|
||||
It has tab-key completion
|
||||
of filenames (csh uses the escape key), and it lets you switch to the
|
||||
directory you were last in with <command>cd -</command>. It's also much
|
||||
easier to alter your prompt with tcsh. It makes life a lot easier.</para>
|
||||
|
||||
<para>Here are the three steps for installing a new shell:</para>
|
||||
|
||||
<para> 1. Install the shell as a port or a package, just as you
|
||||
would any other port or package. Use <command>rehash</command> and
|
||||
<command>which tcsh</command> (assuming you're installing tcsh) to
|
||||
make sure it got installed.</para>
|
||||
|
||||
<para> 2. As root, edit <filename>/etc/shells</filename>, adding
|
||||
a line in the file for the new shell, in this case /usr/local/bin/tcsh,
|
||||
and save the file. (Some ports may do this for you.)</para>
|
||||
|
||||
<para> 3. Use the <command>chsh</command> command to change your shell to
|
||||
tcsh permanently, or type <command>tcsh</command> at the prompt to
|
||||
change your shell without logging in again.</para>
|
||||
|
||||
<para><emphasis>Note: It can be dangerous to change root's shell</emphasis>
|
||||
to something other than sh or csh on early versions of FreeBSD and many
|
||||
other versions of Unix; you may not have a working shell when the system
|
||||
puts you into single user mode. The solution is to use <command>su -m</command>
|
||||
to become root, which will give you the tcsh as root, because the shell is part
|
||||
of the environment. You can make this permanent by adding it to your
|
||||
<filename>.tcshrc</filename> file as an alias with <programlisting>alias su su -m.</></para>
|
||||
|
||||
<para>When tcsh starts up, it will read the
|
||||
<filename>/etc/csh.cshrc</filename> and <filename>/etc/csh.login</filename>
|
||||
files, as does csh. It will also read the
|
||||
<filename>.login</filename> file in your home directory and the
|
||||
<filename>.cshrc</filename>
|
||||
file as well, unless you provide a <filename>.tcshrc</filename>
|
||||
file. This you can do by simply copying <filename>.cshrc</filename>
|
||||
to <filename>.tcshrc</filename>.</para>
|
||||
|
||||
<para>Now that you've installed tcsh, you can adjust your prompt. You can
|
||||
find the details in the manual page for tcsh, but here is a line to
|
||||
put in your <filename>.tcshrc</filename> that will tell you how many
|
||||
commands you have typed, what time it is, and what directory you are in.
|
||||
It also produces a <literal>></literal> if you're an ordinary user and
|
||||
a <literal>#</literal> if you're root, but tsch will do that in any
|
||||
case:</para>
|
||||
<para>
|
||||
set prompt = "%h %t %~ %# "</para>
|
||||
|
||||
<para>This should go in the same place as the existing set prompt line
|
||||
if there is one, or under "if($?prompt) then" if not.
|
||||
Comment out the old line; you can always switch back to it if you prefer
|
||||
it. Don't forget the spaces and quotes. You can get the <filename>.tcshrc</filename> reread by typing <command>source .tcshrc</command>.</para>
|
||||
|
||||
<para>You can get a listing of other environmental variables that
|
||||
have been set by typing <command>env</command> at the prompt. The
|
||||
result will show you your default editor, pager, and terminal type,
|
||||
among possibly many others. A useful command if you log in from a
|
||||
remote location and can't run a program because the terminal isn't
|
||||
capable is
|
||||
<command>setenv TERM vt100</command>.</para>
|
||||
</chapter>
|
||||
|
||||
|
||||
<chapter>
|
||||
<title>Other</title>
|
||||
|
||||
<para>As root, you can dismount the CDROM with <command>/sbin/umount
|
||||
/cdrom</>, take it out of the drive, insert another one, and mount it
|
||||
with <command>/sbin/mount_cd9660 /dev/cd0a /cdrom</> assuming
|
||||
<hardware>cd0a</> is the device name for your CDROM drive.</para>
|
||||
<hardware>cd0a</> is the device name for your CDROM drive. The
|
||||
most recent versions of FreeBSD let you mount the cdrom with just
|
||||
<command>/sbin/mount /cdrom</command>.</para>
|
||||
|
||||
<para>Using the live file system—the second of FreeBSD's CDROM
|
||||
disks—is useful if you've got limited space. You might try
|
||||
using <command>emacs</> or playing games from the cdrom. This
|
||||
disks—is useful if you've got limited space. What is on the
|
||||
live file system varies from release to release. You might try
|
||||
playing games from the cdrom. This
|
||||
involves using <command>lndir</>, which gets installed with the X
|
||||
Window System, to tell the program(s) where to find the necessary
|
||||
files, because they're in the <filename>/cdrom</filename> file system
|
||||
instead of in <filename>/usr</filename> and its subdirectories, which
|
||||
is where they're expected to be. Read <command>man lndir</>.</para>
|
||||
|
||||
<para>You can delete a user (say, jack) by using the command
|
||||
<command>vipw</> to bring up the <filename>master.passwd</filename>
|
||||
file (do not use <command>vi</> directly on master.passwd); delete
|
||||
the line for jack and save the file. Then edit
|
||||
<filename>/etc/group</filename>, eliminating jack wherever it
|
||||
appears. Finally, go to <filename>/usr/home</filename> and use
|
||||
<command>rm -R</command> jack (to get rid of user jack's home
|
||||
directory files).</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
<chapter>
|
||||
|
@ -841,7 +937,7 @@ if it was helpful. My thanks to Eugene W. Stark, professor of
|
|||
computer science at SUNY-Stony Brook, and John Fieber for helpful
|
||||
comments.</para>
|
||||
|
||||
<para>Annelise Anderson, <email>andrsn@hoover.stanford.edu</></para>
|
||||
<para>Annelise Anderson, <email>andrsn@andrsn.stanford.edu</></para>
|
||||
|
||||
</chapter>
|
||||
</book>
|
||||
|
|
Loading…
Reference in a new issue