aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO_8859-1/books/handbook/basics/chapter.sgml
blob: e5fa0fe5da0b12212a196c05010c05155105d8e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!--
     The FreeBSD Documentation Project

     $FreeBSD$
-->

<chapter id="basics">
  <title>Unix Basics</title>
  
  <sect1 id="basics-man">
    <title>The Online Manual</title>
    
    <para>The most comprehensive documentation on FreeBSD is in the form of
      <emphasis>man pages</emphasis>.  Nearly every program on the system
      comes with a short reference manual explaining the basic operation and
      various arguments.  These manuals can be view with the
      <command>man</command> command.  Use of the <command>man</command>
      command is simple:</para>
	  
    <screen>&prompt.user; <userinput>man <replaceable>command</replaceable></userinput></screen>

    <para><replaceable>command</replaceable> is the name of the command you
      wish to learn about.  For example, to learn more about
      <command>ls</command> command type:</para>
	  
    <screen>&prompt.user; <userinput>man ls</userinput></screen>
    
    <para>The online manual is divided up into numbered sections:</para>
    
    <orderedlist>
      <listitem>
	<para>User commands</para>
      </listitem>
      
      <listitem>
	<para>System calls and error numbers</para>
      </listitem>
      
      <listitem>
	<para>Functions in the C libraries</para>
      </listitem>
      
      <listitem>
	<para>Device drivers</para>
      </listitem>
      
      <listitem>
	<para>File formats</para>
      </listitem>
      
      <listitem>
	<para>Games and other diversions</para>
      </listitem>
      
      <listitem>
	<para>Miscellaneous information</para>
      </listitem>
      
      <listitem>
	<para>System maintenance and operation commands</para>
      </listitem>

      <listitem>
	<para>Kernel developers</para>
      </listitem>
    </orderedlist>
    
    <para>In some cases, the same topic may appear in more than one section of
      the on-line manual.  For example, there is a <command>chmod</command>
      user command and a <function>chmod()</function> system call.  In this
      case, you can tell the <command>man</command> command which one you want
      by specifying the section:</para>
    
    <screen>&prompt.user; <userinput>man 1 chmod</userinput></screen>
    
    <para>This will display the manual page for the user command
      <command>chmod</command>.  References to a particular section of the
      on-line manual are traditionally placed in parenthesis in written
      documentation, so &man.chmod.1; refers to the
      <command>chmod</command> user command and &man.chmod.2; refers to the
      system call.</para>
	
    <para>This is fine if you know the name of the command and simply wish to
      know how to use it, but what if you cannot recall the command name? You
      can use <command>man</command> to search for keywords in the command
      <emphasis>descriptions</emphasis> by using the <option>-k</option>
      switch:</para>
	  
    <screen>&prompt.user; <userinput>man -k mail</userinput></screen>
    
    <para>With this command you will be presented with a list of commands that
      have the keyword &ldquo;mail&rdquo; in their descriptions. This is
      actually functionally equivalent to using the <command>apropos</command>
      command.</para>
	
    <para>So, you are looking at all those fancy commands in
      <filename>/usr/bin</filename> but do not even have the faintest idea
      what most of them actually do? Simply do a

      <screen>&prompt.user; <userinput>cd /usr/bin; man -f *</userinput></screen>

      or
      
      <screen>&prompt.user; <userinput>cd /usr/bin; whatis *</userinput></screen>

      which does the same thing.</para>
  </sect1>
      
  <sect1 id="basics-info">
    <title>GNU Info Files</title>
    
    <para>FreeBSD includes many applications and utilities produced by the
      Free Software Foundation (FSF).  In addition to man pages, these
      programs come with more extensive hypertext documents called
      &ldquo;info&rdquo; files which can be viewed with the
      <command>info</command> command or, if you installed
      <command>emacs</command>, the info mode of
      <command>emacs</command>.</para>
	
    <para>To use the &man.info.1; command, simply type:</para>
	  
    <screen>&prompt.user; <userinput>info</userinput></screen>
	  
    <para>For a brief introduction, type <userinput>h</userinput>.  For a
      quick command reference, type <userinput>?</userinput>.</para>
  </sect1>
</chapter>

<!-- 
     Local Variables:
     mode: sgml
     sgml-declaration: "../chapter.decl"
     sgml-indent-data: t
     sgml-omittag: nil
     sgml-always-quote-attributes: t
     sgml-parent-document: ("../book.sgml" "part" "chapter")
     End:
-->