import NVIDIA-FreeBSD-x86-180.29
[nvidia.git] / doc / html / appendix-l.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta name="generator" content=
5 "HTML Tidy for FreeBSD (vers 1 September 2005), see www.w3.org">
6 <meta http-equiv="Content-Type" content=
7 "text/html; charset=us-ascii">
8 <title>Appendix&nbsp;L.&nbsp;Tips for New FreeBSD Users</title>
9 <meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
10 <link rel="start" href="index.html" title=
11 "NVIDIA Accelerated FreeBSD Graphics Driver README and Installation Guide">
12 <link rel="up" href="part-02.html" title=
13 "Part&nbsp;II.&nbsp;Appendices">
14 <link rel="prev" href="appendix-k-section-05.html" title=
15 "Debugging and Tracing">
16 </head>
17 <body>
18 <div class="navheader">
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">Appendix&nbsp;L.&nbsp;Tips for New
22 FreeBSD Users</th>
23 </tr>
24 <tr>
25 <td width="20%" align="left"><a accesskey="p" href=
26 "appendix-k-section-05.html">Prev</a>&nbsp;</td>
27 <th width="60%" align="center">Part&nbsp;II.&nbsp;Appendices</th>
28 <td width="20%" align="right">&nbsp;</td>
29 </tr>
30 </table>
31 <hr></div>
32 <div class="appendix" lang="en">
33 <div class="titlepage">
34 <div>
35 <div>
36 <h2 class="title"><a name="newusertips" id=
37 "newusertips"></a>Appendix&nbsp;L.&nbsp;Tips for New FreeBSD
38 Users</h2>
39 </div>
40 </div>
41 </div>
42 <p>This installation guide assumes that the user has at least a
43 basic understanding of FreeBSD techniques and terminology. In this
44 section we provide tips that the new user may find helpful. While
45 the these tips are meant to clarify and assist users in installing
46 and configuring the NVIDIA FreeBSD Driver, it is by no means a
47 tutorial on the use or administration of the FreeBSD operating
48 system. Unlike many desktop operating systems, it is relatively
49 easy to cause irreparable damage to your FreeBSD system. If you are
50 unfamiliar with the use of FreeBSD, we strongly recommend that you
51 seek a tutorial through your distributor before proceeding.</p>
52 <h3>The command prompt</h3>
53 <p>While newer releases of FreeBSD bring new desktop interfaces to
54 the user, much of the work in FreeBSD takes place at the command
55 prompt. If you are familiar with the Windows operating system, the
56 FreeBSD command prompt is analogous to the Windows command prompt,
57 although the syntax and use varies somewhat. All of the commands in
58 this section are performed at the command prompt. Some systems are
59 configured to boot into console mode, in which case the user is
60 presented with a prompt at login. Other systems are configured to
61 start the X window system, in which case the user must open a
62 terminal or console window in order to get a command prompt. This
63 can usually be done by searching the desktop menus for a terminal
64 or console program. While it is customizable, the basic prompt
65 usually consists of a short string of information, one of the
66 characters <code class="prompt">#</code>, <code class=
67 "prompt">$</code>, or <code class="prompt">%</code>, and a cursor
68 (possibly flashing) that indicates where the user's input will be
69 displayed.</p>
70 <h3>Navigating the directory structure</h3>
71 <p>FreeBSD has a hierarchical directory structure. From anywhere in
72 the directory structure, the <span><strong class=
73 "command">ls</strong></span> command will list the contents of that
74 directory. The <span><strong class="command">file</strong></span>
75 command will print the type of files in a directory. For
76 example,</p>
77 <pre class="screen">
78     % file filename
79 </pre>
80 <p>will print the type of the file <code class=
81 "filename">filename</code>. Changing directories is done with the
82 <span><strong class="command">cd</strong></span> command.</p>
83 <pre class="screen">
84     % cd dirname
85 </pre>
86 <p>will change the current directory to <code class=
87 "filename">dirname</code>. From anywhere in the directory
88 structure, the command <span><strong class=
89 "command">pwd</strong></span> will print the name of the current
90 directory. There are two special directories, <code class=
91 "filename">.</code> and <code class="filename">..</code>, which
92 refer to the current directory and the next directory up the
93 hierarchy, respectively. For any commands that require a file name
94 or directory name as an argument, you may specify the absolute or
95 the relative paths to those elements. An absolute path begins with
96 the "/" character, referring to the top or root of the directory
97 structure. A relative path begins with a directory in the current
98 working directory. The relative path may begin with <code class=
99 "filename">.</code> or <code class="filename">..</code>. Elements
100 of a path are separated with the "/" character. As an example, if
101 the current directory is <code class="filename">/home/jesse</code>
102 and the user wants to change to the <code class=
103 "filename">/usr/local</code> directory, he can use either of the
104 following commands to do so:</p>
105 <pre class="screen">
106     % cd /usr/local
107 </pre>
108 <p>or</p>
109 <pre class="screen">
110     % cd ../../usr/local
111 </pre>
112 <p></p>
113 <h3>File permissions and ownership</h3>
114 <p>All files and directories have permissions and ownership
115 associated with them. This is useful for preventing
116 non-administrative users from accidentally (or maliciously)
117 corrupting the system. The permissions and ownership for a file or
118 directory can be determined by passing the <code class=
119 "option">-l</code> option to the <span><strong class=
120 "command">ls</strong></span> command. For example:</p>
121 <pre class="screen">
122 % ls -l
123 drwxr-xr-x     2    jesse    users    4096    Feb     8 09:32 bin
124 drwxrwxrwx    10    jesse    users    4096    Feb    10 12:04 pub
125 -rw-r--r--     1    jesse    users      45    Feb     4 03:55 testfile
126 -rwx------     1    jesse    users      93    Feb     5 06:20 myprogram
127 -rw-rw-rw-     1    jesse    users     112    Feb     5 06:20 README
128
129 </pre>
130 <p>The first character column in the first output field states the
131 file type, where 'd' is a directory and '-' is a regular file. The
132 next nine columns specify the permissions (see paragraph below) of
133 the element. The second field indicates the number of files
134 associated with the element, the third field indicates the owner,
135 the fourth field indicates the group that the file is associated
136 with, the fifth field indicates the size of the element in bytes,
137 the sixth, seventh and eighth fields indicate the time at which the
138 file was last modified and the ninth field is the name of the
139 element.</p>
140 <p>As stated, the last nine columns in the first field indicate the
141 permissions of the element. These columns are grouped into threes,
142 the first grouping indicating the permissions for the owner of the
143 element (<code class="systemitem">jesse</code> in this case), the
144 second grouping indicating the permissions for the group associated
145 with the element, and the third grouping indicating the permissions
146 associated with the rest of the world. The <code class=
147 "systemitem">r</code>, <code class="systemitem">w</code>, and
148 <code class="systemitem">x</code> indicate read, write and execute
149 permissions, respectively, for each of these associations. For
150 example, user <code class="systemitem">jesse</code> has read and
151 write permissions for <code class="filename">testfile</code>, users
152 in the group <code class="systemitem">users</code> have read
153 permission only, and the rest of the world also has read
154 permissions only. However, for the file <code class=
155 "filename">myprogram</code>, user <code class=
156 "systemitem">jesse</code> has read, write and execute permissions
157 (suggesting that <code class="filename">myprogram</code> is a
158 program that can be executed), while the group <code class=
159 "systemitem">users</code> and the rest of the world have no
160 permissions (suggesting that the owner doesn't want anyone else to
161 run his program). The permissions, ownership and group associated
162 with an element can be changed with the commands
163 <span><strong class="command">chmod</strong></span>,
164 <span><strong class="command">chown</strong></span> and
165 <span><strong class="command">chgrp</strong></span>, respectively.
166 If a user with the appropriate permissions wanted to change the
167 user/group ownership of <code class="filename">README</code> from
168 jesse/users to joe/admin, he would do the following:</p>
169 <pre class="screen">
170     # chown joe README
171     # chgrp admin README
172 </pre>
173 <p>The syntax for chmod is slightly more complicated and has
174 several variations. The most concise way of setting the permissions
175 for a single element uses a triplet of numbers, one for each of
176 user, group and world. The value for each number in the triplet
177 corresponds to a combination of read, write and execute
178 permissions. Execute only is represented as 1, write only is
179 represented as 2, and read only is represented as 4. Combinations
180 of these permissions are represented as sums of the individual
181 permissions. Read and execute is represented as 5, where as read,
182 write and execute is represented as 7. No permissions is
183 represented as 0. Thus, to give the owner read, write and execute
184 permissions, the group read and execute permissions and the world
185 no permissions, a user would do as follows:</p>
186 <pre class="screen">
187     % chmod 750 myprogram
188 </pre>
189 <p></p>
190 <h3>The shell</h3>
191 <p>The shell provides an interface between the user and the
192 operating system. It is the job of the shell to interpret the input
193 that the user gives at the command prompt and call upon the system
194 to do something in response. There are several different shells
195 available, each with somewhat different syntax and capabilities.
196 The two most common flavors of shells used on FreeBSD stem from the
197 Bourne shell (<span><strong class="command">sh</strong></span>) and
198 the C-shell (<span><strong class="command">csh</strong></span>)
199 Different users have preferences and biases towards one shell or
200 the other, and some certainly make it easier (or at least more
201 intuitive) to do some things than others. You can determine your
202 current shell by printing the value of the <code class=
203 "envar">SHELL</code> environment variable from the command prompt
204 with</p>
205 <pre class="screen">
206     % echo $SHELL
207 </pre>
208 <p>You can start a new shell simply by entering the name of the
209 shell from the command prompt:</p>
210 <pre class="screen">
211     % csh
212 </pre>
213 <p>or</p>
214 <pre class="screen">
215     % sh
216 </pre>
217 <p>and you can run a program from within a specific shell by
218 preceding the name of the executable with the name of the shell in
219 which it will be run:</p>
220 <pre class="screen">
221     % sh myprogram
222 </pre>
223 <p>The user's default shell at login is determined by whoever set
224 up his account. While there are many syntactic differences between
225 shells, perhaps the one that is encountered most frequently is the
226 way in which environment variables are set.</p>
227 <h3>Setting environment variables</h3>
228 <p>Every session has associated with it environment variables,
229 which consist of name/value pairs and control the way in which the
230 shell and programs run from the shell behave. An example of an
231 environment variable is the <code class="envar">PATH</code>
232 variable, which tells the shell which directories to search when
233 trying to locate an executable file that the user has entered at
234 the command line. If you are certain that a command exists, but the
235 shell complains that it cannot be found when you try to execute it,
236 there is likely a problem with the <code class="envar">PATH</code>
237 variable. Environment variables are set differently depending on
238 the shell being used. For the Bourne shell (<span><strong class=
239 "command">sh</strong></span>), it is done as:</p>
240 <pre class="screen">
241     % export MYVARIABLE="avalue"
242 </pre>
243 <p>for the C-shell, it is done as:</p>
244 <pre class="screen">
245     % setenv MYVARIABLE "avalue"
246 </pre>
247 <p>In both cases the quotation marks are only necessary if the
248 value contains spaces. The <span><strong class=
249 "command">echo</strong></span> command can be used to examine the
250 value of an environment variable:</p>
251 <pre class="screen">
252     % echo $MYVARIABLE
253 </pre>
254 <p>Commands to set environment variables can also include
255 references to other environment variables (prepended with the "$"
256 character), including themselves. In order to add the path
257 <code class="filename">/usr/local/bin</code> to the beginning of
258 the search path, and the current directory <code class=
259 "filename">.</code> to the end of the search path, a user would
260 enter</p>
261 <pre class="screen">
262     % export PATH=/usr/local/bin:$PATH:.
263 </pre>
264 <p>in the Bourne shell, and</p>
265 <pre class="screen">
266     % setenv PATH /usr/local/bin:${PATH}:.
267 </pre>
268 <p>in C-shell. Note the curly braces are required to protect the
269 variable name in C-shell.</p>
270 <h3>Editing text files</h3>
271 <p>There are several text editors available for the FreeBSD
272 operating system. Some of these editors require the X window
273 system, while others are designed to operate in a console or
274 terminal. It is generally a good thing to be competent with a
275 terminal-based text editor, as there are times when the files
276 necessary for X to run are the ones that must be edited. Three
277 popular editors are <span><strong class=
278 "command">vi</strong></span>, <span><strong class=
279 "command">pico</strong></span> and <span><strong class=
280 "command">emacs</strong></span>, each of which can be started from
281 the command line, optionally supplying the name of a file to be
282 edited. <span><strong class="command">vi</strong></span> is
283 arguably the most ubiquitous as well as the least intuitive of the
284 three. <span><strong class="command">pico</strong></span> is
285 relatively straightforward for a new user, though not as often
286 installed on systems. If you don't have <span><strong class=
287 "command">pico</strong></span>, you may have a similar editor
288 called <span><strong class="command">nano</strong></span>.
289 <span><strong class="command">emacs</strong></span> is highly
290 extensible and fairly widely available, but can be somewhat
291 unwieldy in a non-X environment. The newer versions each come with
292 online help, and offline help can be found in the manual and info
293 pages for each (see the section on FreeBSD Manual and Info pages).
294 Many programs use the <code class="envar">EDITOR</code> environment
295 variable to determine which text editor to start when editing is
296 required.</p>
297 <h3>Root user</h3>
298 <p>Upon installation, almost all distributions set up the default
299 administrative user with the username <code class=
300 "systemitem">root</code>. There are many things on the system that
301 only <code class="systemitem">root</code> (or a similarly
302 privileged user) can do, one of which is installing the NVIDIA
303 FreeBSD Driver. <span class="emphasis"><em>We must emphasize that
304 assuming the identity of <code class="systemitem">root</code> is
305 inherently risky and as <code class="systemitem">root</code> it is
306 relatively easy to corrupt your system or otherwise render it
307 unusable.</em></span> There are three ways to become <code class=
308 "systemitem">root</code>. You may log in as <code class=
309 "systemitem">root</code> as you would any other user, you may use
310 the switch user command (<span><strong class=
311 "command">su</strong></span>) at the command prompt, or, on some
312 systems, use the <span><strong class="command">sudo</strong></span>
313 utility, which allows users to run programs as <code class=
314 "systemitem">root</code> while keeping a log of their actions. This
315 last method is useful in case a user inadvertently causes damage to
316 the system and cannot remember what he has done (or prefers not to
317 admit what he has done). It is generally a good practice to remain
318 <code class="systemitem">root</code> only as long as is necessary
319 to accomplish the task requiring <code class=
320 "systemitem">root</code> privileges (another useful feature of the
321 <span><strong class="command">sudo</strong></span> utility).</p>
322 <h3>FreeBSD Manual and Info pages</h3>
323 <p>System manual or info pages are usually installed during
324 installation. These pages are typically up-to-date and generally
325 contain a comprehensive listing of the use of programs and
326 utilities on the system. Also, many programs include the
327 <code class="option">--help</code> option, which usually prints a
328 list of common options for that program. To view the manual page
329 for a command, enter</p>
330 <pre class="screen">
331     % man commandname
332 </pre>
333 <p>at the command prompt, where <code class=
334 "option">commandname</code> refers to the command in which you are
335 interested. Similarly, entering</p>
336 <pre class="screen">
337     % info commandname
338 </pre>
339 <p>will bring up the info page for the command. Depending on the
340 application, one or the other may be more up-to-date. The interface
341 for the info system is interactive and navigable. If you are unable
342 to locate the man page for the command you are interested in, you
343 may need to add additional elements to your <code class=
344 "envar">MANPATH</code> environment variable. See the section on
345 environment variables.</p>
346 </div>
347 <div class="navfooter">
348 <hr>
349 <table width="100%" summary="Navigation footer">
350 <tr>
351 <td width="40%" align="left"><a accesskey="p" href=
352 "appendix-k-section-05.html">Prev</a>&nbsp;</td>
353 <td width="20%" align="center"><a accesskey="u" href=
354 "part-02.html">Up</a></td>
355 <td width="40%" align="right">&nbsp;</td>
356 </tr>
357 <tr>
358 <td width="40%" align="left" valign="top">Debugging and
359 Tracing&nbsp;</td>
360 <td width="20%" align="center"><a accesskey="h" href=
361 "index.html">Home</a></td>
362 <td width="40%" align="right" valign="top">&nbsp;</td>
363 </tr>
364 </table>
365 </div>
366 </body>
367 </html>