View | Details | Raw Unified | Return to bug 54789
Collapse All | Expand All

(-)en_US.ISO8859-1/articles/new-users/article.sgml (-272 / +180 lines)
Lines 12-18 Link Here
12
12
13
<article>
13
<article>
14
  <articleinfo>
14
  <articleinfo>
15
    <title>For People New to Both FreeBSD and &unix;</title>
15
    <title>For People New to Both &os; and &unix;</title>
16
16
17
    <authorgroup>
17
    <authorgroup>
18
      <author>
18
      <author>
Lines 29-39 Link Here
29
    <pubdate>August 15, 1997</pubdate>
29
    <pubdate>August 15, 1997</pubdate>
30
30
31
    <abstract>
31
    <abstract>
32
      <para>Congratulations on installing FreeBSD! This introduction
32
      <para>Congratulations on installing &os;! This introduction
33
	is for people new to both FreeBSD <emphasis>and</emphasis>
33
	is for people new to both &os; <emphasis>and</emphasis>
34
	Un*x&mdash;so it starts with basics.  It assumes you are using
34
	&unix;&mdash;so it starts with basics.  It assumes you are
35
	version 2.0.5 or later of FreeBSD as distributed by BSDi
35
	using version 2.0.5 or later of &os; as distributed from
36
	or FreeBSD.org, your system (for now) has a single user
36
	FreeBSD.org, your system (for now) has a single user
37
	(you)&mdash;and you are probably pretty good with DOS/Windows
37
	(you)&mdash;and you are probably pretty good with DOS/Windows
38
	or OS/2.</para>
38
	or OS/2.</para>
39
    </abstract>
39
    </abstract>
Lines 42-64 Link Here
42
  <sect1>
42
  <sect1>
43
    <title>Logging in and Getting Out</title>
43
    <title>Logging in and Getting Out</title>
44
44
45
    <para>Log in (when you see <prompt >login:</prompt>) as a user you
45
    <para>Log in (when you see <prompt>login:</prompt>) as a user you
46
      created during installation or as <firstterm>root</firstterm>.
46
      created during installation or as <username>root</username>.
47
      (Your FreeBSD installation will already have an account for
47
      (Your &os; installation will already have an account for
48
      root; root can go anywhere and do anything, including deleting
48
      <username>root</username>; <username>root</username> can go
49
      essential files, so be careful!) The symbols &prompt.user; and
49
      anywhere and do anything, including deleting essential files, so
50
      &prompt.root; in the following stand for the prompt (yours may
50
      be careful!) The symbols &prompt.user; and &prompt.root; in the
51
      be different), with &prompt.user; indicating an ordinary user
51
      following stand for the prompt (yours may be different), with
52
      and &prompt.root; indicating root.</para>
52
      &prompt.user; indicating an ordinary user and &prompt.root;
53
      indicating <username>root</username>.</para>
53
54
54
    <para>To log out (and get a new <prompt >login:</prompt> prompt)
55
    <para>To log out (and get a new <prompt>login:</prompt> prompt)
55
      type</para>
56
      type</para>
56
57
57
    <informalexample>
58
    <informalexample>
58
      <screen>&prompt.root; <userinput>exit</userinput></screen>
59
      <screen>&prompt.root; <userinput>exit</userinput></screen>
59
    </informalexample>
60
    </informalexample>
60
61
61
    <para>as often as necessary.  Yes, press <keysym>enter</keysym>
62
    <para>as often as necessary.  Yes, press <keycap>Enter</keycap>
62
      after commands, and remember that &unix; is
63
      after commands, and remember that &unix; is
63
      case-sensitive&mdash;<command>exit</command>, not
64
      case-sensitive&mdash;<command>exit</command>, not
64
      <command>EXIT</command>.</para>
65
      <command>EXIT</command>.</para>
Lines 84-90 Link Here
84
    <para>You can also reboot with
85
    <para>You can also reboot with
85
      <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Delete</keycap></keycombo>.
86
      <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Delete</keycap></keycombo>.
86
      Give it a little time to do its work.  This is equivalent to
87
      Give it a little time to do its work.  This is equivalent to
87
      <command>/sbin/reboot</command> in recent releases of FreeBSD
88
      <command>/sbin/reboot</command> in recent releases of &os;
88
      and is much, much better than hitting the reset button.  You
89
      and is much, much better than hitting the reset button.  You
89
      do not want to have to reinstall this thing, do you?</para>
90
      do not want to have to reinstall this thing, do you?</para>
90
  </sect1>
91
  </sect1>
Lines 92-148 Link Here
92
  <sect1>
93
  <sect1>
93
    <title>Adding A User with Root Privileges</title>
94
    <title>Adding A User with Root Privileges</title>
94
95
95
    <para>If you did not create any users when you installed the system
96
    <para>If you did not create any users when you installed the
96
      and are thus logged in as root, you should probably create a
97
      system and are thus logged in as <username>root</username>, you
97
      user now with</para>
98
      should probably create a user now with</para>
98
99
99
    <informalexample>
100
    <informalexample>
100
      <screen>&prompt.root; <userinput>adduser</userinput></screen>
101
      <screen>&prompt.root; <userinput>adduser</userinput></screen>
101
    </informalexample>
102
    </informalexample>
102
103
103
    <para>The first time you use adduser, it might ask for some
104
    <para>The first time you use <command>adduser</command>, it might
104
      defaults to save.  You might want to make the default shell
105
      ask for some defaults to save.  You might want to make the
105
      &man.csh.1; instead of &man.sh.1;, if it suggests
106
      default shell &man.csh.1; instead of &man.sh.1;, if it suggests
106
      <command>sh</command> as the default.  Otherwise just press
107
      <command>sh</command> as the default.  Otherwise just press
107
      enter to accept each default.  These defaults are saved in
108
      enter to accept each default.  These defaults are saved in
108
      <filename>/etc/adduser.conf</filename>, an editable file.</para>
109
      <filename>/etc/adduser.conf</filename>, an editable file.</para>
109
110
110
    <para>Suppose you create a user <username>jack</username> with
111
    <para>Suppose you create a user <username>jack</username> with
111
      full name <emphasis>Jack Benimble</emphasis>.  Give jack a
112
      full name <emphasis>Jack Benimble</emphasis>.  Give
112
      password if security (even kids around who might pound on the
113
      <username>jack</username> a password if security (even kids
113
      keyboard) is an issue.  When it asks you if you want to invite
114
      around who might pound on the keyboard) is an issue.  When it
114
      jack into other groups, type <groupname>wheel</groupname></para>
115
      asks you if you want to invite <username>jack</username> into
116
      other groups, type <groupname>wheel</groupname>:</para>
115
117
116
    <informalexample>
118
    <informalexample>
117
      <screen>Login group is ``jack''. Invite jack into other groups: <userinput>wheel</userinput></screen>
119
      <screen>Login group is ``jack''. Invite jack into other groups: <userinput>wheel</userinput></screen>
118
    </informalexample>
120
    </informalexample>
119
121
120
    <para>This will make it possible to log in as
122
    <para>This will make it possible to log in as
121
      <username>jack</username> and use the &man.su.1;
123
      <username>jack</username> and use the &man.su.1; command to
122
      command to become root.  Then you will not get scolded any more for
124
      become <username>root</username>.  Then you will not get scolded
123
      logging in as root.</para>
125
      any more for logging in as <username>root</username>.</para>
124
126
125
    <para>You can quit <command>adduser</command> any time by typing
127
    <para>You can quit <command>adduser</command> any time by typing
126
      <keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo>,
128
      <keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo>,
127
      and at the end you will have a chance to approve your new user or
129
      and at the end you will have a chance to approve your new user or
128
      simply type <keycap>n</keycap> for no.  You might want to create
130
      simply type <keycap>n</keycap> for no.  You might want to create
129
      a second new user (jill?) so that when you edit jack's login
131
      a second new user (<username>jill</username>?) so that when you
130
      files, you will have a hot spare in case something goes
132
      edit <username>jack</username>'s login files, you will have a
131
      wrong.</para>
133
      hot spare in case something goes wrong.</para>
132
134
133
    <para>Once you have done this, use <command>exit</command> to get
135
    <para>Once you have done this, use <command>exit</command> to get
134
      back to a login prompt and log in as <username>jack</username>.
136
      back to a login prompt and log in as <username>jack</username>.
135
      In general, it is a good idea to do as much work as possible as
137
      In general, it is a good idea to do as much work as possible as
136
      an ordinary user who does not have the power&mdash;and
138
      an ordinary user who does not have the power&mdash;and
137
      risk&mdash;of root.</para>
139
      risk&mdash;of <username>root</username>.</para>
138
140
139
    <para>If you already created a user and you want the user to be
141
    <para>If you already created a user and you want the user to be
140
      able to <command>su</command> to root, you can log in as root
142
      able to <command>su</command> to <username>root</username>, you
141
      and edit the file <filename>/etc/group</filename>, adding jack
143
      can log in as <username>root</username> and edit the file
142
      to the first line (the group <groupname>wheel</groupname>).  But
144
      <filename>/etc/group</filename>, adding
143
      first you need to practice &man.vi.1;, the text editor&mdash;or
145
      <username>jack</username> to the first line (the group
144
      use the simpler text editor, &man.ee.1;, installed on recent
146
      <groupname>wheel</groupname>).  But first you need to practice
145
      version of FreeBSD.</para>
147
      &man.vi.1;, the text editor&mdash;or use the simpler text
148
      editor, &man.ee.1;, installed on recent version of
149
      &os;.</para>
146
150
147
    <para>To delete a user, use the <command>rmuser</command>
151
    <para>To delete a user, use the <command>rmuser</command>
148
      command.</para>
152
      command.</para>
Lines 153-159 Link Here
153
157
154
    <para>Logged in as an ordinary user, look around and try out some
158
    <para>Logged in as an ordinary user, look around and try out some
155
      commands that will access the sources of help and information
159
      commands that will access the sources of help and information
156
      within FreeBSD.</para>
160
      within &os;.</para>
157
161
158
    <para>Here are some commands and what they do:</para>
162
    <para>Here are some commands and what they do:</para>
159
163
Lines 208-215 Link Here
208
212
209
	<listitem>
213
	<listitem>
210
	  <para>Lists hidden <quote>dot</quote> files with the others.
214
	  <para>Lists hidden <quote>dot</quote> files with the others.
211
	    If you are root, the <quote>dot</quote> files show up
215
	    If you are <username>root</username>, the
212
	    without the <option>-a</option> switch.</para>
216
	    <quote>dot</quote> files show up without the
217
	    <option>-a</option> switch.</para>
213
	</listitem>
218
	</listitem>
214
      </varlistentry>
219
      </varlistentry>
215
220
Lines 221-227 Link Here
221
	    <parameter>..</parameter></command> backs up one level;
226
	    <parameter>..</parameter></command> backs up one level;
222
	    note the space after <command>cd</command>.  <command>cd
227
	    note the space after <command>cd</command>.  <command>cd
223
	    <parameter>/usr/local</parameter></command> goes there.
228
	    <parameter>/usr/local</parameter></command> goes there.
224
	    <command>cd <parameter>~</parameter></command> goes to the
229
	    <command>cd</command> (without any options) goes to the
225
	    home directory of the person logged in&mdash;e.g.,
230
	    home directory of the person logged in&mdash;e.g.,
226
	    <filename>/usr/home/jack</filename>.  Try <command>cd
231
	    <filename>/usr/home/jack</filename>.  Try <command>cd
227
	    <parameter>/cdrom</parameter></command>, and then
232
	    <parameter>/cdrom</parameter></command>, and then
Lines 298-304 Link Here
298
303
299
	<listitem>
304
	<listitem>
300
	  <para>The manual page for <replaceable>text</replaceable>.  The
305
	  <para>The manual page for <replaceable>text</replaceable>.  The
301
	    major source of documentation for Un*x systems.
306
	    major source of documentation for &unix; systems.
302
	    <command>man <parameter>ls</parameter></command> will tell
307
	    <command>man <parameter>ls</parameter></command> will tell
303
	    you all the ways to use the <command>ls</command> command.
308
	    you all the ways to use the <command>ls</command> command.
304
	    Press <keycap>Enter</keycap> to move through text,
309
	    Press <keycap>Enter</keycap> to move through text,
Lines 371-380 Link Here
371
    <para>Are some of these not working very well?  Both
376
    <para>Are some of these not working very well?  Both
372
      &man.locate.1; and &man.whatis.1; depend
377
      &man.locate.1; and &man.whatis.1; depend
373
      on a database that is rebuilt weekly.  If your machine is not
378
      on a database that is rebuilt weekly.  If your machine is not
374
      going to be left on over the weekend (and running FreeBSD), you
379
      going to be left on over the weekend (and running &os;), you
375
      might want to run the commands for daily, weekly, and monthly
380
      might want to run the commands for daily, weekly, and monthly
376
      maintenance now and then.  Run them as root and give each one
381
      maintenance now and then.  Run them as <username>root</username>
377
      time to finish before you start the next one, for now.</para>
382
      and give each one time to finish before you start the next one,
383
      for now.</para>
378
384
379
    <informalexample>
385
    <informalexample>
380
      <screen>&prompt.root; <userinput>periodic daily</userinput>
386
      <screen>&prompt.root; <userinput>periodic daily</userinput>
Lines 399-413 Link Here
399
    <para>Running such commands is part of system
405
    <para>Running such commands is part of system
400
      administration&mdash;and as a single user of a Unix system,
406
      administration&mdash;and as a single user of a Unix system,
401
      you are your own system administrator.  Virtually everything you
407
      you are your own system administrator.  Virtually everything you
402
      need to be root to do is system administration.  Such
408
      need to be <username>root</username> to do is system
403
      responsibilities are not covered very well even in those big fat
409
      administration.  Such responsibilities are not covered very well
404
      books on Unix, which seem to devote a lot of space to pulling
410
      even in those big fat books on Unix, which seem to devote a lot
405
      down menus in windows managers.  You might want to get one of
411
      of space to pulling down menus in windows managers.  You might
406
      the two leading books on systems administration, either Evi
412
      want to get one of the two leading books on systems
407
      Nemeth et.al.'s <citetitle>UNIX System Administration
413
      administration, either Evi Nemeth et.al.'s <citetitle>UNIX
408
      Handbook</citetitle> (Prentice-Hall, 1995, ISBN
414
      System Administration Handbook</citetitle> (Prentice-Hall, 1995,
409
      0-13-15051-7)&mdash;the second edition with the red cover; or
415
      ISBN 0-13-15051-7)&mdash;the second edition with the red cover;
410
      &AElig;leen Frisch's <citetitle>Essential System
416
      or &AElig;leen Frisch's <citetitle>Essential System
411
      Administration</citetitle> (O'Reilly &amp; Associates, 1993,
417
      Administration</citetitle> (O'Reilly &amp; Associates, 1993,
412
      ISBN 0-937175-80-3).  I used Nemeth.</para>
418
      ISBN 0-937175-80-3).  I used Nemeth.</para>
413
  </sect1>
419
  </sect1>
Lines 417-430 Link Here
417
423
418
    <para>To configure your system, you need to edit text files.  Most
424
    <para>To configure your system, you need to edit text files.  Most
419
      of them will be in the <filename>/etc</filename> directory; and
425
      of them will be in the <filename>/etc</filename> directory; and
420
      you will need to <command>su</command> to root to be able to
426
      you will need to <command>su</command> to
421
      change them.  You can use the easy <command>ee</command>, but in
427
      <username>root</username> to be able to change them.  You can
422
      the long run the text editor <command>vi</command> is worth
428
      use the easy <command>ee</command>, but in the long run the text
423
      learning.  There is an excellent tutorial on vi in
429
      editor <command>vi</command> is worth learning.  There is an
430
      excellent tutorial on vi in
424
      <filename>/usr/src/contrib/nvi/docs/tutorial</filename> if you
431
      <filename>/usr/src/contrib/nvi/docs/tutorial</filename> if you
425
      have that installed; otherwise you can get it by FTP to
432
      have the system sources installed.</para>
426
      <hostid>ftp.cdrom.com</hostid> in the directory
427
      FreeBSD/FreeBSD-current/src/contrib/nvi/docs/tutorial.</para>
428
433
429
    <para>Before you edit a file, you should probably back it up.
434
    <para>Before you edit a file, you should probably back it up.
430
      Suppose you want to edit <filename>/etc/rc.conf</filename>.  You
435
      Suppose you want to edit <filename>/etc/rc.conf</filename>.  You
Lines 598-647 Link Here
598
      <command>:w</command>) when you need to.</para>
603
      <command>:w</command>) when you need to.</para>
599
604
600
    <para>Now you can <command>cd</command> to
605
    <para>Now you can <command>cd</command> to
601
      <filename>/etc</filename>, <command>su</command> to root, use
606
      <filename>/etc</filename>, <command>su</command> to
602
      <command>vi</command> to edit the file
607
      <username>root</username>, use <command>vi</command> to edit the
603
      <filename>/etc/group</filename>, and add a user to wheel so the
608
      file <filename>/etc/group</filename>, and add a user to
604
      user has root privileges.  Just add a comma and the user's login
609
      <groupname>wheel</groupname> so the user has
605
      name to the end of the first line in the file, press
610
      <username>root</username> privileges.  Just add a comma and the
606
      <keycap>Esc</keycap>, and use <command>:wq</command> to write
611
      user's login name to the end of the first line in the file,
607
      the file to disk and quit.  Instantly effective.  (You did not
612
      press <keycap>Esc</keycap>, and use <command>:wq</command> to
608
      put a space after the comma, did you?)</para>
613
      write the file to disk and quit.  Instantly effective.  (You did
614
      not put a space after the comma, did you?)</para>
609
  </sect1>
615
  </sect1>
610
616
611
  <sect1>
617
  <sect1>
612
    <title>Printing Files from DOS</title>
618
    <title>Printing Files from Windows</title>
613
619
614
    <para>At this point you probably do not have the printer working,
620
    <para>At this point you probably do not have the printer working,
615
      so here is a way to create a file from a manual page, move it to a
621
      so here is a way to create a file from a manual page, move it to a
616
      floppy, and then print it from DOS.  Suppose you want to read
622
      floppy, and then print it from Windows.  Suppose you want to read
617
      carefully about changing permissions on files (pretty
623
      carefully about changing permissions on files (pretty
618
      important).  You can use <command>man chmod</command> to read
624
      important).  You can use <command>man chmod</command> to read
619
      about it.  The command</para>
625
      about it.  The command</para>
620
626
621
    <informalexample>
627
    <informalexample>
622
      <screen>&prompt.user; <userinput>man chmod | col -b &gt; chmod.txt</></screen>
628
      <screen>&prompt.user; <userinput>man chmod | col -b &gt; chmod.txt</userinput></screen>
623
    </informalexample>
629
    </informalexample>
624
630
625
    <para>will remove formatting codes and send the manual page to the
631
    <para>will remove formatting codes and send the manual page to the
626
      <filename>chmod.txt</filename> file instead of showing it on
632
      <filename>chmod.txt</filename> file instead of showing it on
627
      your screen.  Now put a dos-formatted diskette in your floppy
633
      your screen.  Now put a dos-formatted diskette in your floppy
628
      drive a, <command>su</command> to root, and type</para>
634
      drive <devicename>a</devicename>, <command>su</command> to
635
      <username>root</username>, and type</para>
629
636
630
    <informalexample>
637
    <informalexample>
631
      <screen>&prompt.root; <userinput>/sbin/mount -t msdos /dev/fd0 /mnt</></screen>
638
      <screen>&prompt.root; <userinput>/sbin/mount -t msdos /dev/fd0 /mnt</userinput></screen>
632
    </informalexample>
639
    </informalexample>
633
640
634
    <para>to mount the floppy drive on
641
    <para>to mount the floppy drive on
635
      <filename>/mnt</filename>.</para>
642
      <filename>/mnt</filename>.</para>
636
643
637
    <para>Now (you no longer need to be root, and you can type
644
    <para>Now you can go to the directory where you created
638
      <command>exit</command> to get back to being user jack) you can
639
      go to the directory where you created
640
      <filename>chmod.txt</filename> and copy the file to the floppy
645
      <filename>chmod.txt</filename> and copy the file to the floppy
641
      with:</para>
646
      with:</para>
642
647
643
    <informalexample>
648
    <informalexample>
644
      <screen>&prompt.user; <userinput>cp chmod.txt /mnt</></screen>
649
      <screen>&prompt.root; <userinput>cp chmod.txt /mnt</userinput></screen>
645
    </informalexample>
650
    </informalexample>
646
651
647
    <para>and use <command>ls /mnt</command> to get a directory
652
    <para>and use <command>ls /mnt</command> to get a directory
Lines 652-698 Link Here
652
      <filename>/sbin/dmesg</filename> by typing</para>
657
      <filename>/sbin/dmesg</filename> by typing</para>
653
658
654
    <informalexample>
659
    <informalexample>
655
      <screen>&prompt.user; <userinput>/sbin/dmesg &gt; dmesg.txt</></screen>
660
      <screen>&prompt.user; <userinput>/sbin/dmesg &gt; dmesg.txt</userinput></screen>
656
    </informalexample>
661
    </informalexample>
657
662
658
    <para>and copying <filename>dmesg.txt</filename> to the floppy.
663
    <para>and copying <filename>dmesg.txt</filename> to the floppy.
659
      <command>/sbin/dmesg</command> is the boot log record, and it is
664
      <command>/sbin/dmesg</command> is the boot log record, and it is
660
      useful to understand it because it shows what FreeBSD found when
665
      useful to understand it because it shows what &os; found when
661
      it booted up.  If you ask questions on the &a.questions; or on a USENET
666
      it booted up.  If you ask questions on the &a.questions; or on a USENET
662
      group&mdash;like <quote>FreeBSD is not finding my tape drive,
667
      group&mdash;like <quote>&os; is not finding my tape drive,
663
      what do I do?</quote>&mdash;people will want to know what
668
      what do I do?</quote>&mdash;people will want to know what
664
      <command>dmesg</command> has to say.</para>
669
      <command>dmesg</command> has to say.</para>
665
670
666
    <para>You can now dismount the floppy drive (as root) to get the
671
    <para>You can now unmount the floppy drive (as
667
      disk out with</para>
672
      <username>root</username>) to get the disk out with</para>
668
673
669
    <informalexample>
674
    <informalexample>
670
      <screen>&prompt.root; <userinput>/sbin/umount /mnt</></screen>
675
      <screen>&prompt.root; <userinput>/sbin/umount /mnt</userinput></screen>
671
    </informalexample>
676
    </informalexample>
672
677
673
    <para>and reboot to go to DOS.  Copy these files to a DOS
678
    <para>and reboot to go to Windows.  Copy these files to a Windows
674
      directory, call them up with DOS EDIT, Windows Notepad or
679
      directory, call them up with Notepad or Wordpad, or a word
675
      Wordpad, or a word processor, make a minor change so the file
680
      processor, make a minor change so the file has to be saved, and
676
      has to be saved, and print as you normally would from DOS or
681
      print as you normally would from Windows.  Hope it works!
677
      Windows.  Hope it works!  manual pages come out best if printed
682
      Manual pages come out best if printed with the DOS
678
      with the DOS <command>print</command> command.  (Copying files
683
      <command>print</command> command.  (Copying files from &os;
679
      from FreeBSD to a mounted DOS partition is in some cases still a
684
      to a mounted DOS partition is in some cases still a little
680
      little risky.)</para>
685
      risky.)</para>
681
686
682
    <para>Getting the printer printing from FreeBSD involves creating
687
    <para>Getting the printer printing from &os; involves creating
683
      an appropriate entry in <filename>/etc/printcap</filename> and
688
      an appropriate entry in <filename>/etc/printcap</filename> and
684
      creating a matching spool directory in
689
      creating a matching spool directory in
685
      <filename>/var/spool/output</filename>.  If your printer is on
690
      <filename>/var/spool/output</filename>.  If your printer is on
686
      <hardware>lpt0</hardware> (what DOS calls
691
      <devicename>lpt0</devicename> (what Windows calls
687
      <hardware>LPT1</hardware>), you may only need to go to
692
      <devicename>LPT1</devicename>), you may only need to go to
688
      <filename>/var/spool/output</filename> and (as root) create the
693
      <filename>/var/spool/output</filename> and (as
689
      directory <filename>lpd</filename> by typing: <command>mkdir
694
      <username>root</username>) create the directory
695
      <filename>lpd</filename> by typing: <command>mkdir
690
      lpd</command>, if it does not already exist.  Then the printer
696
      lpd</command>, if it does not already exist.  Then the printer
691
      should respond if it is turned on when the system is booted, and
697
      should respond if it is turned on when the system is booted, and
692
      <command>lp</command> or <command>lpr</command> should send a
698
      <command>lp</command> or <command>lpr</command> should send a
693
      file to the printer.  Whether or not the file actually prints
699
      file to the printer.  Whether or not the file actually prints
694
      depends on configuring it, which is covered in the <ulink
700
      depends on configuring it, which is covered in the <ulink
695
      URL="../../books/handbook/index.html">FreeBSD
701
      URL="../../books/handbook/index.html">&os;
696
      handbook.</ulink></para>
702
      handbook.</ulink></para>
697
  </sect1>
703
  </sect1>
698
704
Lines 751-757 Link Here
751
	<term><command>passwd</command></term>
757
	<term><command>passwd</command></term>
752
758
753
	<listitem>
759
	<listitem>
754
	  <para>to change user's password (or root's password)</para>
760
	  <para>to change user's password (or
761
	    <username>root</username> password)</para>
755
	</listitem>
762
	</listitem>
756
      </varlistentry>
763
      </varlistentry>
757
764
Lines 769-775 Link Here
769
      with</para>
776
      with</para>
770
777
771
    <informalexample>
778
    <informalexample>
772
      <screen>&prompt.user; <userinput>find /usr -name "<replaceable>filename</>"</></screen>
779
      <screen>&prompt.user; <userinput>find /usr -name "<replaceable>filename</>"</userinput></screen>
773
    </informalexample>
780
    </informalexample>
774
781
775
    <para>You can use <literal>*</literal> as a wildcard in
782
    <para>You can use <literal>*</literal> as a wildcard in
Lines 780-791 Link Here
780
      file(s) on all mounted filesystems, including the CDROM and the
787
      file(s) on all mounted filesystems, including the CDROM and the
781
      DOS partition.</para>
788
      DOS partition.</para>
782
789
783
    <para>An excellent book that explains Unix commands and utilities
790
    <para>An excellent book that explains &unix; commands and utilities
784
      is Abrahams &amp; Larson, <citetitle>Unix for the
791
      is Abrahams &amp; Larson, <citetitle>Unix for the
785
	Impatient</citetitle> (2nd ed., Addison-Wesley, 1996).
792
	Impatient</citetitle> (2nd ed., Addison-Wesley, 1996).
786
      There is also a lot of Unix information on the Internet.  Try the
793
      There is also a lot of &unix; information on the Internet.  Try
787
      <ulink URL="http://www.geek-girl.com/unix.html">Unix Reference
794
      searching with your favourite search engine.</para>
788
	Desk</ulink>.</para>
789
  </sect1>
795
  </sect1>
790
796
791
  <sect1>
797
  <sect1>
Lines 793-801 Link Here
793
799
794
    <para>You should now have the tools you need to get around and
800
    <para>You should now have the tools you need to get around and
795
      edit files, so you can get everything up and running.  There is
801
      edit files, so you can get everything up and running.  There is
796
      a great deal of information in the FreeBSD handbook (which is
802
      a great deal of information in the &os; handbook (which is
797
      probably on your hard drive) and <ulink
803
      probably on your hard drive) and <ulink
798
      URL="../../../../index.html">FreeBSD's web site</ulink>.  A
804
      URL="http://www.freebsd.org">&os;'s web site</ulink>.  A
799
      wide variety of packages and ports are on the CDROM as well as
805
      wide variety of packages and ports are on the CDROM as well as
800
      the web site.  The handbook tells you more about how to use them
806
      the web site.  The handbook tells you more about how to use them
801
      (get the package if it exists, with <command>pkg_add
807
      (get the package if it exists, with <command>pkg_add
Lines 803-919 Link Here
803
      where <replaceable>packagename</replaceable> is the filename of
809
      where <replaceable>packagename</replaceable> is the filename of
804
      the package).  The CDROM has lists of the packages and ports
810
      the package).  The CDROM has lists of the packages and ports
805
      with brief descriptions in
811
      with brief descriptions in
806
      <filename>cdrom/packages/index</filename>,
812
      <filename>/cdrom/packages/index</filename>,
807
      <filename>cdrom/packages/index.txt</filename>, and
813
      <filename>/cdrom/packages/index.txt</filename>, and
808
      <filename>cdrom/ports/index</filename>, with fuller descriptions
814
      <filename>/cdrom/ports/index</filename>, with fuller descriptions
809
      in <filename>/cdrom/ports/*/*/pkg/DESCR</filename>, where the
815
      in <filename>/cdrom/ports/*/*/pkg/DESCR</filename>, where the
810
      <literal>*</literal>s represent subdirectories of kinds of
816
      <literal>*</literal> represents subdirectories of kinds of
811
      programs and program names respectively.</para>
817
      programs and program names respectively.</para>
812
818
813
    <para>If you find the handbook too sophisticated (what with
819
    <para>If you already have a working internet connection, you can
814
      <command>lndir</command> and all) on installing ports from the
820
      also add a package with <command>pkg_add -r
815
      CDROM, here is what usually works:</para>
821
      <replaceable>packagename</replaceable></command>. This will
816
822
      fetch the desired package from an FTP server and install
817
    <para>Find the port you want, say <command>kermit</command>.
823
      it.</para>
818
      There will be a directory for it on the CDROM.  Copy the
819
      subdirectory to <filename>/usr/local</filename> (a good place
820
      for software you add that should be available to all users)
821
      with:</para>
822
823
    <informalexample>
824
      <screen>&prompt.root; <userinput>cp -R /cdrom/ports/comm/kermit /usr/local</></screen>
825
    </informalexample>
826
824
827
    <para>This should result in a
828
      <filename>/usr/local/kermit</filename> subdirectory that has all
829
      the files that the <command>kermit</command> subdirectory on the
830
      CDROM has.</para>
831
832
    <para>Next, create the directory
833
      <filename>/usr/ports/distfiles</filename> if it does not already
834
      exist using <command>mkdir</command>.  Now check
835
      <filename>/cdrom/ports/distfiles</filename> for a file with a
836
      name that indicates it is the port you want.  Copy that file to
837
      <filename>/usr/ports/distfiles</filename>; in recent versions
838
      you can skip this step, as FreeBSD will do it for you.  In the
839
      case of <command>kermit</command>, there is no distfile.</para>
840
841
    <para>Then <command>cd</command> to the subdirectory of
842
      <filename>/usr/local/kermit</filename> that has the file
843
      <filename>Makefile</filename>.  Type</para>
844
845
    <informalexample>
846
      <screen>&prompt.root; <userinput>make all install</></screen>
847
    </informalexample>
848
849
    <para>During this process the port will FTP to get any compressed
850
      files it needs that it did not find on the CDROM or in
851
      <filename>/usr/ports/distfiles</filename>.  If you do not have
852
      your network running yet and there was no file for the port in
853
      <filename>/cdrom/ports/distfiles</filename>, you will have to
854
      get the distfile using another machine and copy it to
855
      <filename>/usr/ports/distfiles</filename> from a floppy or your
856
      DOS partition.  Read <filename>Makefile</filename> (with
857
      <command>cat</command> or <command>more</command> or
858
      <command>view</command>) to find out where to go (the master
859
      distribution site) to get the file and what its name is.  Its
860
      name will be truncated when downloaded to DOS, and after you get
861
      it into <filename>/usr/ports/distfiles</filename> you will have to
862
      rename it (with the <command>mv</command> command) to its
863
      original name so it can be found.  (Use binary file transfers!)
864
      Then go back to <filename>/usr/local/kermit</filename>, find the
865
      directory with <filename>Makefile</filename>, and type
866
      <command>make all install</command>.</para>
867
868
    <para>The other thing that happens when installing ports or
869
      packages is that some other program is needed.  If the
870
      installation stops with a message <errorname>can't find
871
	unzip</errorname> or whatever, you might need to install the
872
      package or port for unzip before you continue.</para>
873
874
    <para>Once it is installed type <command>rehash</command> to make
875
      FreeBSD reread the files in the path so it knows what is there.
876
      (If you get a lot of <errorname>path not found</errorname>
877
      messages when you use <command>whereis</command> or which, you
878
      might want to make additions to the list of directories in the
879
      path statement in <filename>.cshrc</filename> in your home
880
      directory.  The path statement in Unix does the same kind of
881
      work it does in DOS, except the current directory is not (by
882
      default) in the path for security reasons; if the command you
883
      want is in the directory you are in, you need to type
884
      <filename>./</filename> before the command to make it work; no
885
      space after the slash.)</para>
886
887
    <para>You might want to get the most recent version of Netscape
888
      from their <ulink URL="ftp://ftp.netscape.com/">FTP site</ulink>.
889
      (Netscape requires the X Window System.) There is now a FreeBSD
890
      version, so look around carefully.  Just use <command>gunzip
891
      <replaceable>filename</replaceable></command> and <command>tar
892
      xvf <replaceable>filename</replaceable></command> on it, move
893
      the binary to <filename>/usr/local/bin</filename> or some other
894
      place binaries are kept, <command>rehash</command>, and then put
895
      the following lines in <filename>.cshrc</filename> in each
896
      user's home directory or (easier) in
897
      <filename>/etc/csh.cshrc</filename>, the system-wide
898
      <command>csh</command> start-up file:</para>
899
900
    <informalexample>
901
      <programlisting>setenv XKEYSYMDB /usr/X11R6/lib/X11/XKeysymDB
902
setenv XNLSPATH /usr/X11R6/lib/X11/nls</programlisting>
903
    </informalexample>
904
905
    <para>This assumes that the file <filename>XKeysymDB</filename>
906
      and the directory <filename>nls</filename> are in
907
      <filename>/usr/X11R6/lib/X11</filename>; if they are not, find
908
      them and put them there.</para>
909
910
    <para>If you originally got Netscape as a port using the CDROM (or
911
      FTP), do not replace <filename>/usr/local/bin/netscape</filename>
912
      with the new netscape binary; this is just a shell script that
913
      sets up the environment variables for you.  Instead rename the
914
      new binary to <filename>netscape.bin</filename> and replace the
915
      old binary, which is
916
      <filename>/usr/local/netscape/netscape</filename>.</para>
917
  </sect1>
825
  </sect1>
918
826
919
  <sect1>
827
  <sect1>
Lines 927-1015 Link Here
927
      files: a series of commands to be run without your
835
      files: a series of commands to be run without your
928
      intervention.</para>
836
      intervention.</para>
929
837
930
    <para>Two shells come installed with FreeBSD:
838
    <para>Two shells come installed with &os;:
931
      <command>csh</command> and <command>sh</command>.
839
      <command>csh</command> and <command>sh</command>.
932
      <command>csh</command> is good for command-line work, but
840
      <command>csh</command> is good for command-line work, but
933
      scripts should be written with <command>sh</command> (or
841
      scripts should be written with <command>sh</command> (or
934
      <command>bash</command>).  You can find out what shell you have
842
      <command>bash</command>).  You can find out what shell you have
935
      by typing <command>echo $SHELL</command>.</para>
843
      by typing <command>echo $SHELL</command>.</para>
936
844
937
    <para>The <command>csh</command> shell is okay, but
845
    <para>The <command>csh</command> shell is okay, but you might want
938
      <command>tcsh</command> does everything <command>csh</command>
846
      to use <command>bash</command>, as many users might find it more
939
      does and more.  It allows you to recall commands with the arrow
847
      comfortable.  It allows you to recall commands with the arrow
940
      keys and edit them.  It has tab-key completion of filenames
848
      keys and edit them.  It has tab-key completion of filenames
941
      (<command>csh</command> uses the <keycap>Esc</keycap> key), and
849
      (<command>csh</command> uses the <keycap>Esc</keycap> key), and
942
      it lets you switch to the directory you were last in with
850
      it lets you switch to the directory you were last in with
943
      <command>cd -</command>.  It is also much easier to alter your
851
      <command>cd -</command>.  It is also much easier to alter your
944
      prompt with <command>tcsh</command>.  It makes life a lot
852
      prompt with <command>bash</command>.  It makes life a lot
945
      easier.</para>
853
      easier.</para>
946
854
947
    <para>Here are the three steps for installing a new shell:</para>
855
    <para>Here are the two steps for installing a new shell:</para>
948
856
949
    <procedure>
857
    <procedure>
950
      <step>
858
      <step>
951
	<para>Install the shell as a port or a package, just as you
859
	<para>Install the shell as a port or a package, just as you
952
	  would any other port or package.  Use
860
	  would any other port or package.  Use
953
	  <command>rehash</command> and <command>which tcsh</command>
861
	  <command>rehash</command> and <command>which bash</command>
954
	  (assuming you are installing <command>tcsh</command>) to make
862
	  (assuming you are installing <command>bash</command>) to make
955
	  sure it got installed.</para>
863
	  sure it got installed.</para>
956
      </step>
864
      </step>
957
865
958
      <step>
866
      <step>
959
	<para>As root, edit <filename>/etc/shells</filename>, adding a
960
	  line in the file for the new shell, in this case
961
	  <filename>/usr/local/bin/tcsh</filename>, and save the file.
962
	  (Some ports may do this for you.)</para>
963
      </step>
964
965
      <step>
966
	<para>Use the <command>chsh</command> command to change your
867
	<para>Use the <command>chsh</command> command to change your
967
	  shell to <command>tcsh</command> permanently, or type
868
	  shell to <command>bash</command> permanently, or type
968
	  <command>tcsh</command> at the prompt to change your shell
869
	  <command>bash</command> at the prompt to change your shell
969
	  without logging in again.</para>
870
	  without logging in again.</para>
970
      </step>
871
      </step>
971
    </procedure>
872
    </procedure>
972
873
973
    <note>
874
    <note>
974
      <para>It can be dangerous to change root's shell to something
875
      <para>It can be dangerous to change <username>root</username>'s
975
	other than <command>sh</command> or <command>csh</command> on
876
	shell to something other than <command>sh</command> or
976
	early versions of FreeBSD and many other versions of Unix; you
877
	<command>csh</command> on early versions of &os; and many
977
	may not have a working shell when the system puts you into
878
	other versions of &unix;; you may not have a working shell when
978
	single user mode.  The solution is to use <command>su
879
	the system puts you into single user mode.  The solution is to
979
	-m</command> to become root, which will give you the
880
	use <command>su -m</command> to become
980
	<command>tcsh</command> as root, because the shell is part of
881
	<username>root</username>, which will give you the
981
	the environment.  You can make this permanent by adding it to
882
	<command>bash</command> as <username>root</username>, because
982
	your <filename>.tcshrc</filename> file as an alias with:</para>
883
	the shell is part of the environment.  You can make this
983
	<programlisting>alias su su -m</programlisting>
884
	permanent by adding it to your <filename>.profile</filename>
885
	file as an alias with:</para>
886
887
      <programlisting>alias su='su -m'</programlisting>
984
    </note>
888
    </note>
985
889
986
    <para>When <command>tcsh</command> starts up, it will read the
890
    <para>When <command>bash</command> starts up, it reads a variety
987
      <filename>/etc/csh.cshrc</filename> and
891
      of configuration files like <filename>/etc/profile</filename>,
988
      <filename>/etc/csh.login</filename> files, as does
892
      <filename>.bash_profile</filename>,
989
      <command>csh</command>.  It will also read the
893
      <filename>.bash_login</filename> &hellip;, depending on if it is
990
      <filename>.login</filename> file in your home directory and the
894
      invoked as a login shell or not.  A safe way to make sure that
991
      <filename>.cshrc</filename> file as well, unless you provide a
895
      <command>bash</command> executes the commands you want whenever
992
      <filename>.tcshrc</filename> file.  This you can do by simply
896
      it starts up is to put them into your
993
      copying <filename>.cshrc</filename> to
897
      <filename>.profile</filename> and create a symbolic link from
994
      <filename>.tcshrc</filename>.</para>
898
      <filename>.bashrc</filename> to <filename>.profile</filename>
899
      like this:</para>
900
901
    <informalexample>
902
      <screen>&prompt.user; <userinput>ln -s .profile .bashrc</userinput></screen>
903
    </informalexample>
995
904
996
    <para>Now that you have installed <command>tcsh</command>, you can
905
    <para>Now that you have installed <command>bash</command>, you can
997
      adjust your prompt.  You can find the details in the manual page
906
      adjust your prompt.  You can find the details in the manual page
998
      for <command>tcsh</command>, but here is a line to put in your
907
      for <command>bash</command>, but here is a line to put in your
999
      <filename>.tcshrc</filename> that will tell you how many
908
      <filename>.profile</filename> that will tell you how many
1000
      commands you have typed, what time it is, and what directory you
909
      commands you have typed, what time it is, and what directory you
1001
      are in.  It also produces a <literal>></literal> if you are an
910
      are in.  It also produces a <literal>$</literal> if you are
1002
      ordinary user and a <literal>#</literal> if you are root, but
911
      an ordinary user and a <literal>#</literal> if you are
1003
      tsch will do that in any case:</para>
912
      <username>root</username>:</para>
1004
913
1005
    <para>set prompt = "%h %t %~ %# "</para>
914
    <programlisting>PS1='\! \A \w \$ '; export PS1</programlisting>
1006
915
1007
    <para>This should go in the same place as the existing set prompt
916
    <para>Just append this line to <filename>.profile</filename>  Do
1008
      line if there is one, or under "if($?prompt) then" if not.
917
      not forget the spaces and quotes.  You can get the
1009
      Comment out the old line; you can always switch back to it if
918
      <filename>.profile</filename> reread by typing <command>source
1010
      you prefer it.  Do not forget the spaces and quotes.  You can get
919
      .profile</command>.</para>
1011
      the <filename>.tcshrc</filename> reread by typing
1012
      <command>source .tcshrc</command>.</para>
1013
920
1014
    <para>You can get a listing of other environmental variables that
921
    <para>You can get a listing of other environmental variables that
1015
      have been set by typing <command>env</command> at the prompt.
922
      have been set by typing <command>env</command> at the prompt.
Lines 1017-1037 Link Here
1017
      terminal type, among possibly many others.  A useful command if
924
      terminal type, among possibly many others.  A useful command if
1018
      you log in from a remote location and can not run a program
925
      you log in from a remote location and can not run a program
1019
      because the terminal is not capable is <command>setenv TERM
926
      because the terminal is not capable is <command>setenv TERM
1020
      vt100</command>.</para>
927
      vt100</command> (for <command>csh</command>) or <command>export
928
      TERM=vt100</command> (for <command>bash</command>).</para>
1021
  </sect1>
929
  </sect1>
1022
930
1023
  <sect1>
931
  <sect1>
1024
    <title>Other</title>
932
    <title>Other</title>
1025
933
1026
    <para>As root, you can dismount the CDROM with
934
    <para>As <username>root</username>, you can unmount the CDROM with
1027
      <command>/sbin/umount /cdrom</command>, take it out of the
935
      <command>/sbin/umount /cdrom</command>, take it out of the
1028
      drive, insert another one, and mount it with
936
      drive, insert another one, and mount it with
1029
      <command>/sbin/mount_cd9660 /dev/cd0a /cdrom</command> assuming
937
      <command>/sbin/mount_cd9660 /dev/cd0a /cdrom</command> assuming
1030
      <hardware>cd0a</hardware> is the device name for your CDROM
938
      <devicename>cd0a</devicename> is the device name for your CDROM
1031
      drive.  The most recent versions of FreeBSD let you mount the
939
      drive.  The most recent versions of &os; let you mount the
1032
      CDROM with just <command>/sbin/mount /cdrom</command>.</para>
940
      CDROM with just <command>/sbin/mount /cdrom</command>.</para>
1033
941
1034
    <para>Using the live filesystem&mdash;the second of FreeBSD's
942
    <para>Using the live filesystem&mdash;the second of &os;'s
1035
      CDROM disks&mdash;is useful if you have got limited space.  What
943
      CDROM disks&mdash;is useful if you have got limited space.  What
1036
      is on the live filesystem varies from release to release.  You
944
      is on the live filesystem varies from release to release.  You
1037
      might try playing games from the CDROM.  This involves using
945
      might try playing games from the CDROM.  This involves using

Return to bug 54789