Gentoo Archives: gentoo-doc-cvs

From: Xavier Neys <neysx@×××××××××××.org>
To: gentoo-doc-cvs@l.g.o
Subject: [gentoo-doc-cvs] cvs commit: info-guide.xml man-guide.xml metadoc.xml
Date: Sat, 27 May 2006 14:35:37
Message-Id: 20060527143525.EE508643E0@smtp.gentoo.org
1 neysx 06/05/27 14:35:25
2
3 Modified: metadoc.xml
4 Added: info-guide.xml man-guide.xml
5 Log:
6 #127954 & #127826 new {info,man}\guide.ml docs
7
8 Revision Changes Path
9 1.152 xml/htdocs/doc/en/metadoc.xml
10
11 file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/metadoc.xml?rev=1.152&content-type=text/x-cvsweb-markup&cvsroot=gentoo
12 plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/metadoc.xml?rev=1.152&content-type=text/plain&cvsroot=gentoo
13 diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/metadoc.xml.diff?r1=1.151&r2=1.152&cvsroot=gentoo
14
15 Index: metadoc.xml
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v
18 retrieving revision 1.151
19 retrieving revision 1.152
20 diff -u -r1.151 -r1.152
21 --- metadoc.xml 1 May 2006 17:06:16 -0000 1.151
22 +++ metadoc.xml 27 May 2006 14:35:25 -0000 1.152
23 @@ -1,9 +1,9 @@
24 <?xml version='1.0' encoding="UTF-8"?>
25 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.151 2006/05/01 17:06:16 neysx Exp $ -->
26 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.152 2006/05/27 14:35:25 neysx Exp $ -->
27 <!DOCTYPE metadoc SYSTEM "/dtd/metadoc.dtd">
28
29 <metadoc lang="en">
30 -<version>1.79</version>
31 +<version>1.81</version>
32 <members>
33 <lead>neysx</lead>
34 <member>fox2mike</member>
35 @@ -267,6 +267,7 @@
36 <file id="source_mirrors">/doc/en/source_mirrors.xml</file>
37 <file id="gentoo-ppc-install">/doc/en/gentoo-ppc-install.xml</file>
38 <file id="gentoo-x86-quickinstall">/doc/en/gentoo-x86-quickinstall.xml</file>
39 + <file id="gentoo-x86-quickinstall+raid">/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml</file>
40 <file id="vi-guide">/doc/en/vi-guide.xml</file>
41 <file id="virt-mail-howto">/doc/en/virt-mail-howto.xml</file>
42 <file id="mailfilter-guide">/doc/en/mailfilter-guide.xml</file>
43 @@ -392,6 +393,8 @@
44 <file id="jffnms">/doc/en/jffnms.xml</file>
45 <file id="conky">/doc/en/conky-howto.xml</file>
46 <file id="ldapdns">/doc/en/ldapdns-guide.xml</file>
47 + <file id="man-guide">/doc/en/man-guide.xml</file>
48 + <file id="info-guide">/doc/en/info-guide.xml</file>
49 </files>
50 <docs>
51 <doc id="name-logo">
52 @@ -615,6 +618,10 @@
53 <memberof>install_guides</memberof>
54 <fileid>gentoo-x86-quickinstall</fileid>
55 </doc>
56 + <doc id="gentoo-x86-quickinstall+raid">
57 + <memberof>install_guides</memberof>
58 + <fileid>gentoo-x86-quickinstall+raid</fileid>
59 + </doc>
60 <doc id="gentoo-sparc-quickinstall">
61 <memberof>install_guides</memberof>
62 <fileid>gentoo-sparc-quickinstall</fileid>
63 @@ -1253,5 +1260,13 @@
64 <memberof>sysadmin_specific</memberof>
65 <fileid>ldapdns</fileid>
66 </doc>
67 + <doc id="man-guide">
68 + <memberof>sysadmin_general</memberof>
69 + <fileid>man-guide</fileid>
70 + </doc>
71 + <doc id="info-guide">
72 + <memberof>sysadmin_general</memberof>
73 + <fileid>info-guide</fileid>
74 + </doc>
75 </docs>
76 </metadoc>
77
78
79
80 1.1 xml/htdocs/doc/en/info-guide.xml
81
82 file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/info-guide.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
83 plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/info-guide.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo
84
85 Index: info-guide.xml
86 ===================================================================
87 <?xml version="1.0" encoding="UTF-8"?>
88 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
89 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/info-guide.xml,v 1.1 2006/05/27 14:35:25 neysx Exp $ -->
90
91 <guide link="/doc/en/info-guide.xml" lang="en">
92 <title>Gentoo Info Guide</title>
93
94 <author title="Chris White">
95 <mail link="chriswhite@g.o">Chris White</mail>
96 </author>
97
98 <abstract>
99 This guide is meant to show how to navigate info pages using the info command.
100 </abstract>
101
102 <!-- The content of this document is licensed under the CC-BY-SA license -->
103 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
104 <license/>
105
106 <version>1</version>
107 <date>2006-03-28</date>
108
109 <chapter>
110 <title>Introduction</title>
111 <section>
112 <title>What is info?</title>
113 <body>
114
115 <p>
116 Most of you may be familiar with the <c>man</c> documentation system. While man
117 is good with quickly looking up items, it lacks structure in linking man pages
118 together. This is where <c>info</c> comes in. Info pages are made using the
119 <c>texinfo</c> tools, and can link with other pages, create menus and ease
120 navigation in general. The next section will look at how info pages are laid
121 out.
122 </p>
123
124 </body>
125 </section>
126 <section>
127 <title>Info pages layout</title>
128 <body>
129
130 <p>
131 The main info pages are held in <path>/usr/share/info</path>. Unlike the man
132 style directory layout, <path>/usr/share/info</path> contains what is largely a
133 rather extensive collection of files. These files have the following format:
134 </p>
135
136 <pre caption="info file format">
137 pagename.info[-node].gz
138 </pre>
139
140 <p>
141 <c>pagename</c> is the actual name of the page (example: <c>wget</c>).
142 <c>[-node]</c> is an optional construct that designates another node level
143 (generally these are referenced to by the toplevel of the info document in
144 question). In order to save space these info pages are compressed using the
145 <c>gzip</c> compression scheme. Additional info pages can be listed with the
146 <c>INFOPATH</c> environment variable (usually set through the various
147 <path>/etc/env.d/</path> files). To get started, it's important to note the
148 <path>/usr/share/info/dir</path> file. This special file is used when info is
149 ran with no parameters. It contains a listing of all info pages available for
150 users to browse. To begin looking at navigating around in info, we'll go ahead
151 and bring it up with no arguments:
152 </p>
153
154 <pre caption="Starting up info">
155 $ <i>info</i>
156 </pre>
157
158 <p>
159 Now in the next chapter we'll look at dealing with basic info navigation.
160 </p>
161
162 </body>
163 </section>
164 </chapter>
165 <chapter>
166 <title>Working with info pages</title>
167 <section>
168 <title>Browsing with menus</title>
169 <body>
170
171 <p>
172 Now that info is started, we're given a screen similar to this:
173 </p>
174
175 <pre caption="Sample info screen">
176 File: dir, Node: Top This is the top of the INFO tree
177
178 This (the Directory node) gives a menu of major topics.
179 Typing "q" exits, "?" lists all Info commands, "d" returns here,
180 "h" gives a primer for first-timers,
181 "mEmacs&lt;Return&gt;" visits the Emacs manual, etc.
182
183 In Emacs, you can click mouse button 2 on a menu item or cross reference
184 to select it.
185
186 * Menu:
187
188 User Interface Toolkit
189 * GDK: (gdk). The General Drawing Kit
190 * GTK: (gtk). The GIMP Toolkit
191
192 GNU programming tools
193 * Autoconf v2.1: (autoconf). Create source code configuration scripts.
194 </pre>
195
196 <p>
197 Right now there are a bunch of entries with an asterisk before them. These are
198 menu items for navigating through different node levels. There are two ways of
199 selecting menus. We'll look at the first now and the other way later. First
200 off, we'll go ahead and look at the <c>wget</c> info page. To do so, use the
201 down error key until you reach the area indicated by the blue highlighting:
202 </p>
203
204 <pre caption="Navigating to the wget info menu entry">
205 Network Applications
206 * GnuTLS: (gnutls). Package for Transport Layer Security.
207 * <i>Wget: (wget).</i> The non-interactive network downloader.
208 * certtool: (gnutls)Invoking certtool. Manipulate certificates and keys.
209 * gnutls-cli: (gnutls)Invoking gnutls-cli. GNU TLS test client.
210 * gnutls-cli-debug: (gnutls)Invoking gnutls-cli-debug. GNU TLS debug client.
211 * gnutls-serv: (gnutls)Invoking gnutls-serv. GNU TLS test server.
212 * srptool: (gnutls)Invoking srptool. Simple SRP password tool.
213 </pre>
214
215 <p>
216 Once you get to this area, hit the <c>ENTER</c> key to select the menu item.
217 This will bring up the info page for <c>wget</c>:
218 </p>
219
220 <pre caption="The wget info page">
221 File: wget.info, Node: Top, Next: Overview, Up: (dir)
222
223 Wget 1.10.2
224 ***********
225
226 This manual documents version 1.10.2 of GNU Wget, the freely available
227 utility for network downloads.
228
229 Copyright (C) 1996-2005 Free Software Foundation, Inc.
230
231 * Menu:
232
233 * Overview:: Features of Wget.
234 * Invoking:: Wget command-line arguments.
235 * Recursive Download:: Downloading interlinked pages.
236 * Following Links:: The available methods of chasing links.
237 * Time-Stamping:: Mirroring according to time-stamps.
238 * Startup File:: Wget's initialization file.
239 </pre>
240
241 <p>
242 Now that we have an info page up, the next section will look at basic
243 navigation.
244 </p>
245
246 </body>
247 </section>
248 <section>
249 <title>Basic navigation</title>
250 <body>
251
252 <p>
253 In terms of nodes, this is considered the <c>Top</c> node for the wget page.
254 Consider the <c>Top</c> node to be the same as the table of contents for that
255 particular info page. Now to navigate the actual page itself, you have a couple
256 of different methods. First off is the standard info method. This is using the
257 <c>SPACE</c> key to move forward a page and the <c>BACKSPACE/DELETE</c> keys to
258 move back a page. This is the recommended method as it automatically
259 advances/retreats to the appropriate node in the document. This allows for a
260 somewhat linear browsing for those used to man pages. Another way is through
261 the <c>PAGE UP/PAGE DOWN</c> keys. These work, but they will not
262 advance/retreat like <c>SPACE/BACKSPACE/DELETE</c> will. If you want to skip
263 entire nodes without using <c>SPACE/BACKSPACE/DELETE</c>, you can also use the
264 <c>[</c> (advance backwards) and <c>]</c> (advance forwards) keys.
265 </p>
266
267 <p>
268 As mentioned earlier, there are 2 ways of navigating menus. The other way will
269 now be described here. The numbers <c>1-9</c> can be used to reference to the
270 first-ninth menu entries in a document. This can be used to quickly peruse
271 through documents. For example, we'll use <c>3</c> to reach the <c>Recursive
272 Download</c> menu entry. So press <c>3</c> and it will bring up the
273 <c>Recursive Download</c> screen:
274 </p>
275
276 <pre caption="Resulting Recursive Download screen">
277 File: wget.info, Node: Recursive Download, Next: Following Links, Prev: Invoking, Up: Top
278
279 3 Recursive Download
280 ********************
281
282 GNU Wget is capable of traversing parts of the Web (or a single HTTP or
283 FTP server), following links and directory structure. We refer to this
284 as to "recursive retrieval", or "recursion".
285 </pre>
286
287 <p>
288 Now we're at the <c>Recursive Download</c> screen. Here is a good time to note
289 a few things. First off the top header section. This header shows the
290 navigation capable from this particular screen. The page indicated by
291 <c>Next: </c> can be accessed by pressing the <c>n</c> key, and the page
292 indicated by <c>Prev: </c> can be accessed by pressing the <c>p</c> key. Please
293 note that this will only work for the same level. If overused you could round
294 up in totally unrelated content. It's better to use
295 <c>SPACE/BACKSPACE/DELETE/[/]</c> to navigate in a linear fashion.
296 </p>
297
298 <p>
299 If for some reason you get lost, there are a few ways to get out. First is the
300 <c>t</c> key. This will take you straight to the toplevel (table of contents)
301 for the particular info page you're browsing. If you want to return to the last
302 page you looked out, you can do so with the <c>l</c> key. If you want to go to
303 the above level, you can do so with the <c>u</c> key. Now that you have some
304 idea of navigating a page, the next chapter will look at searching for content.
305 </p>
306
307 </body>
308 </section>
309 </chapter>
310
311 <chapter>
312 <title>Searching through info</title>
313 <section>
314 <title>Navigating to other info pages</title>
315 <body>
316
317 <p>
318 Now that you can navigate an individual info page, it's important to look at
319 accessing other info pages. The first obvious way is to go to the info page
320 through the <c>dir</c> index listing of info pages. To get to the <c>dir</c>
321 index from deep within a document, simply press the <c>d</c> key. From there
322 you can search for the appropriate page you want. However, if you know the
323 actual page, there is an easier way through the <c>Goto node (g key)</c> command.
324 To go to an info page by name, type <c>g</c> to bring up the prompt and enter the
325 name of the page in parentheses:
326 </p>
327
328 <pre caption="Going to an info page by name">
329 * Startup File:: Wget's initialization file.
330 * Examples:: Examples of usage.
331 * Various:: The stuff that doesn't fit anywhere else.
332 * Appendices:: Some useful references.
333 * Copying:: You may give out copies of Wget and of this manual.
334 --zz-Info: (wget.info.gz)Top, 24 lines --Top-------------------------------
335 Goto node: <i>(libc)</i>
336 </pre>
337
338 <p>
339 This will bring up the libc page as shown here:
340 </p>
341
342 <pre caption="Result of the Goto node command">
343 File: libc.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
344
345 Main Menu
346 *********
347
348 This is Edition 0.10, last updated 2001-07-06, of `The GNU C Library
349 Reference Manual', for Version 2.3.x of the GNU C Library.
350
351 * Menu:
352
353 * Introduction:: Purpose of the GNU C Library.
354 </pre>
355
356 <p>
357 Now that we know how to go to info pages by name, the next section will look at
358 searching for pieces of information using the info page's index.
359 </p>
360
361 </body>
362 </section>
363 <section>
364 <title>Searching using an index</title>
365 <body>
366
367 <p>
368 In this example we'll see how to lookup the <c>printf</c> function of the c
369 library using the <c>libc</c> info page's index. You should still be at the
370 libc info page from the last section, and if not, use the Goto node command to
371 do so. To utilize the index search, hit the <c>i</c> key to bring up the
372 prompt, then enter your search term. We'll do so for <c>printf</c> below:
373 </p>
374
375 <pre caption="Entering an index search query">
376 * Character Set Handling:: Support for extended character sets.
377 * Locales:: The country and language can affect the
378 behavior of library functions.
379 * Message Translation:: How to make the program speak the user's
380 language.
381 --zz-Info: (libc.info.gz)Top, 1291 lines --Top-- Subfile: libc.info-1.gz-----
382 Index entry: <i>printf</i>
383 </pre>
384
385 <p>
386 After pressing enter upon completion of our query, we're brought to the
387 <c>libc</c> definition for <c>printf</c>:
388 </p>
389
390 <pre caption="Result of the index search query">
391 File: libc.info, Node: Formatted Output Functions, Next: Dynamic Output, Prev: Other Output Conversions, Up: Formatted Output
392
393 12.12.7 Formatted Output Functions
394 ----------------------------------
395
396 This section describes how to call <i>`printf'</i> and related functions.
397 Prototypes for these functions are in the header file `stdio.h'.
398 Because these functions take a variable number of arguments, you _must_
399 declare prototypes for them before using them. Of course, the easiest
400 way to make sure you have all the right prototypes is to just include
401 </pre>
402
403 <p>
404 We've now successfully performed a search using the <c>libc</c> info page
405 index. However, sometimes what we want is in the page itself. The next section
406 will look at performing searches within the page.
407 </p>
408
409 </body>
410 </section>
411 <section>
412 <title>Searching using the search command</title>
413 <body>
414
415 <p>
416 Starting from the previous location at the <c>Formatted Output Functions</c>
417 node, we'll look at searching for the <c>sprintf</c> variation of the
418 <c>printf</c> function. To perform a search, press the <c>s</c> key to
419 bring up the search prompt, and then enter the query (sprintf in this case):
420 </p>
421
422 <pre caption="Entering a search query">
423 -- Function: int wprintf (const wchar_t *TEMPLATE, ...)
424 The `wprintf' function prints the optional arguments under the
425 control of the wide template string TEMPLATE to the stream
426 `stdout'. It returns the number of wide characters printed, or a
427 --zz-Info: (libc.info.gz)Formatted Output Functions, 127 lines --Top-- Subfile: libc.info-3.gz--
428 Search for string []: <i>sprintf</i>
429 </pre>
430
431 <p>
432 Hit <c>ENTER</c> and it will show the result of the query:
433 </p>
434
435 <pre caption="Result of the search query">
436 -- Function: int <i>sprintf</i> (char *S, const char *TEMPLATE, ...)
437 This is like `printf', except that the output is stored in the
438 character array S instead of written to a stream. A null
439 character is written to mark the end of the string.
440
441 The `sprintf' function returns the number of characters stored in
442 the array S, not including the terminating null character.
443 </pre>
444
445 <p>
446 And we have the function we need.
447 </p>
448
449 </body>
450 </section>
451 </chapter>
452
453 <chapter>
454 <title>Conclusion</title>
455 <section>
456 <title>Conclusion</title>
457 <body>
458
459 <p>
460 This concludes the overview of using info to view info pages. As always
461 comments are both welcome and appreciated. Clicking on the my name (Chris
462 White) on the right side will send me an email.
463 </p>
464
465 </body>
466 </section>
467 <section>
468 <title>Additional Program Resources</title>
469 <body>
470
471 <p>
472 In order to make things easier for those that wish to browse info pages through
473 a more friendly graphical interface, the following are available:
474 </p>
475
476 <ul>
477 <li>app-text/info2html - Convert info pages to a browse-able HTML format</li>
478 <li>app-text/pinfo - <c>ncurses</c> based info viewer</li>
479 <li>app-text/tkinfo - a <c>tcl/tk</c> based info browser</li>
480 <li>app-vim/info - a <c>vim</c> based info browser</li>
481 </ul>
482
483 <p>
484 The <c>KDE</c> browser <c>Konqueror</c> also allows you to browse info pages
485 through the <c>info: </c> URI.
486 </p>
487
488 </body>
489 </section>
490 </chapter>
491 </guide>
492
493
494
495 1.1 xml/htdocs/doc/en/man-guide.xml
496
497 file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/man-guide.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
498 plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/man-guide.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo
499
500 Index: man-guide.xml
501 ===================================================================
502 <?xml version="1.0" encoding="UTF-8"?>
503 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
504 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/man-guide.xml,v 1.1 2006/05/27 14:35:25 neysx Exp $ -->
505
506 <guide link="/doc/en/man-guide.xml" lang="en">
507 <title>Gentoo Man Guide</title>
508
509 <author title="Author">
510 <mail link="chriswhite@g.o">Chris White</mail>
511 </author>
512
513 <abstract>
514 This guide shows how to navigate man pages using man.
515 </abstract>
516
517 <!-- The content of this document is licensed under the CC-BY-SA license -->
518 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
519 <license/>
520
521 <version>1</version>
522 <date>2005-03-27</date>
523
524 <chapter>
525 <title>Introduction</title>
526 <section>
527 <title>The man program</title>
528 <body>
529
530 <p>
531 Everyone at some point in their linux life has used it. "It" is the <c>man</c>
532 command. However, while the man program itself appears to be rather simplistic
533 in its construct, it has a few extra abilities than just simply scrolling
534 through the page. This document hopes to achieve shedding some light on these
535 capabilities.
536 </p>
537
538 </body>
539 </section>
540 <section>
541 <title>Man layout</title>
542 <body>
543
544 <p>
545 Man pages are mainly stored in the <path>/usr/share/man</path> directory.
546 However, as long as a man page is located in the <c>MANPATH</c> environment
547 variable, man will be able to pick it up. Gentoo will generally store
548 <c>MANPATH</c> variables in <path>/etc/env.d</path>. Within these directories
549 are some folders with the structure manX where X is the section number. For
550 example, a standard man layout might look like so:
551 </p>
552
553 <pre caption="Standard man structure">
554 $ <i>ls /usr/share/man | grep man</i>
555 man0p
556 man1
557 man1p
558 man2
559 man3
560 man3p
561 man4
562 man5
563 man6
564 man7
565 man8
566 man9
567 mann
568 </pre>
569
570 <p>
571 The actual section numbering appears fairly standard. However, notice that
572 there is a <path>mann</path> and some <path>man#p</path> folders. The following
573 table lists the above man page directories and what is contained within them:
574 </p>
575
576 <table>
577 <tr>
578 <th>Man Directory</th>
579 <th>Description</th>
580 </tr>
581 <tr>
582 <ti>man0p</ti>
583 <ti>
584 The <c>p</c> here stands for POSIX, as with the other directories with p in
585 their names. Man pages in this directory describe the functionality of
586 various POSIX header files.
587 </ti>
588 </tr>
589 <tr>
590 <ti>man1</ti>
591 <ti>
592 This section is for standard commands. Most programs will put their man
593 pages here, so this section tends to be the largest.
594 </ti>
595 </tr>
596 <tr>
597 <ti>man1p</ti>
598 <ti>
599 This section describes the POSIX versions of the commands described in 1p.
600 Since it only describes basic commands, it is much smaller than man1.
601 </ti>
602 </tr>
603 <tr>
604 <ti>man2</ti>
605 <ti>This section describes Linux kernel system calls.</ti>
606 </tr>
607 <tr>
608 <ti>man3</ti>
609 <ti>This section describes standard c library functions.</ti>
610 </tr>
611 <tr>
612 <ti>man4</ti>
613 <ti>
614 This section describes special devices. These devices are generally kernel
615 oriented, but <c>Xorg-X11</c> has entries in here as well.
616 </ti>
617 </tr>
618 <tr>
619 <ti>man5</ti>
620 <ti>
621 This section describes both the makeup of certain files and what files a
622 program uses. Those of you reading this document may be familiar with
623 references to <c>man 5 portage</c> for a description of the <c>portage</c>
624 file structure, and <c>man 5 make.conf</c> for <path>make.con</path>
625 makeup.
626 </ti>
627 </tr>
628 <tr>
629 <ti>man6</ti>
630 <ti>This section introduces games and other special toys.</ti>
631 </tr>
632 <tr>
633 <ti>man7</ti>
634 <ti>
635 This section describes standards and other miscellaneous items. These
636 standards can include things such as charsets, SQL statements, ISO
637 standards and regular expressions.
638 </ti>
639 </tr>
640 <tr>
641 <ti>man8</ti>
642 <ti>
643 This section describes administrative commands (those usually run by the
644 root user).
645 </ti>
646 </tr>
647 <tr>
648 <ti>man9</ti>
649 <ti>
650 This section is somewhat sparse, but is meant to contain documentation for
651 various parts of the kernel.
652 </ti>
653 </tr>
654 <tr>
655 <ti>mann</ti>
656 <ti>
657 This section is mainly used by <c>Tcl/Tk</c>. The <c>n</c> stands for new.
658 </ti>
659 </tr>
660 </table>
661
662 <p>
663 While this is not an extensive and detailed list, it does cover the man pages
664 that most people will be interested in. However, sometimes you can find out
665 what a section does as easily as looking at this table. The next chapter will
666 look at using man to traverse this layout.
667 </p>
668
669 </body>
670 </section>
671 </chapter>
672
673 <chapter>
674 <title>Working with the man layout</title>
675 <section>
676 <title>Browsing the man layout</title>
677 <body>
678
679 <p>
680 Now that we understand the man layout, we can begin to look it over for
681 commands. Sometimes we may need to narrow down what man page we want. The first
682 way would be addressing by section. To found out a description of a section,
683 once can use <c>man section intro</c> like so:
684 </p>
685
686 <pre caption="Using man intro to describe a section">
687 $ man 3 intro
688 <comment>(Output slightly modified to fit the document properly)</comment>
689 INTRO(3) Linux Programmer's Manual INTRO(3)
690
691
692
693 NAME
694 intro - Introduction to library functions
695
696 DESCRIPTION
697 This chapter describes all library functions excluding the library
698 functions described in chapter 2, which implement system calls.
699 There are various function groups which can be identified by a
700 letter which is appended to the chapter number:
701 ....
702 </pre>
703
704 <p>
705 Unfortunately, this doesn't always work! However, luckily for us there is
706 another way to search for commands that may return multiple results (such as a
707 library call and system command having the same name). To do so, we use the
708 <c>-K</c> parameter to man like so:
709 </p>
710
711 <pre caption="Using man -K to search by string">
712 $ <i>man -K sleep</i>
713 /usr/share/man/man0p/time.h.0p.gz? [ynq] <i>n</i>
714 /usr/share/man/man0p/unistd.h.0p.gz? [ynq] <i>n</i>
715 /usr/share/man/man2/alarm.2.gz? [ynq] <i>n</i>
716 /usr/share/man/man2/pause.2.gz? [ynq] <i>n</i>
717 /usr/share/man/man2/futex.2.gz? [ynq] <i>n</i>
718 /usr/share/man/man2/nanosleep.2.gz? [ynq] <i>y</i>
719 /usr/share/man/man2/semop.2.gz? [ynq] <i>q</i>
720 </pre>
721
722 <p>
723 Sometimes the output may be a lot larger. In this case it might be better to
724 specify more specific keywords. Now that we know where to find the man page,
725 the next section will look at viewing the man page.
726 </p>
727
728 </body>
729 </section>
730 <section>
731 <title>Viewing man pages</title>
732 <body>
733
734 <p>
735 Viewing man pages can be done in 2 ways, first is with <c>man [man page
736 name]</c>. The second way is <c>man [section] [man page name]</c>. Let's take
737 <c>bc</c> for example. I can view either the first man page that comes up on
738 <c>bc</c> (which would be section 1, because it is the lowest section
739 containing a man page on <c>bc</c>):
740 </p>
741
742 <pre caption="Viewing the default man page">
743 $ <i>man bc</i>
744 bc(1) bc(1)
745
746
747 NAME
748 bc - An arbitrary precision calculator language
749 ...
750 </pre>
751
752 <p>
753 However, what if I want the POSIX version? Then I can use the second form:
754 </p>
755
756 <pre caption="Viewing a specific man page by section">
757 $ <i>man 1p bc</i>
758 BC(P) POSIX Programmer's Manual BC(P)
759
760
761 NAME
762 bc - arbitrary-precision arithmetic language
763 ...
764 </pre>
765
766 <p>
767 And the man page is displayed. Now that we have the man page up, it's time to
768 work with it. The next section will look at navigation and searching.
769 </p>
770
771 </body>
772 </section>
773 <section>
774 <title>Navigating and searching man pages</title>
775 <body>
776
777 <p>
778 Navigating a man page is fairly simple. To move up and down line by line, use
779 the up and down arrow keys. To move up page by page, you can use the page up
780 and page down keys. Do however note that these navigation instructions assume
781 the environmental <c>PAGER</c> variable is set to use the default pager,
782 <c>less</c>. Less also has a few other commands for navigation, but the arrow
783 keys usually suffice:
784 </p>
785
786 <pre caption="Additional less navigation keys">
787 e ^E j ^N CR * Forward one line (or N lines).
788 y ^Y k ^K ^P * Backward one line (or N lines).
789 f ^F ^V SPACE * Forward one window (or N lines).
790 b ^B ESC-v * Backward one window (or N lines).
791 z * Forward one window (and set window to N).
792 w * Backward one window (and set window to N).
793 ESC-SPACE * Forward one window, but don't stop at end-of-file.
794 d ^D * Forward one half-window (and set half-window to N).
795 u ^U * Backward one half-window (and set half-window to N).
796 ESC-) RightArrow * Left one half screen width (or N positions).
797 ESC-( LeftArrow * Right one half screen width (or N positions).
798 F Forward forever; like "tail -f".
799 </pre>
800
801 <p>
802 Searching, however, is more intesting. The two most basic searches are
803 <c>/pattern</c> and <c>?pattern</c>. The first version searches forwards, and
804 the second searches backwards. <c>pattern</c> is a regular expression pattern
805 that is described in <c>man 7 regex</c>. Let's take for example searching for
806 the <c>-D</c> option to <c>emerge</c>. First, bring up the emerge man page:
807 </p>
808
809 <pre caption="Bringing up the emerge man page">
810 $ <i>man emerge</i>
811 </pre>
812
813 <p>
814 Then, at the screen, press the <c>/</c> key to bring up the entry prompt to
815 search forwards and enter in our search pattern:
816 </p>
817
818 <pre caption="Bringing up the forward search prompt">
819 gracefully handles updating installed packages to newer releases as well.
820 It handles both source and binary packages, and it can be used to create
821 binary packages for distribution.
822
823 EBUILDS, TBZ2S, CLASSES AND DEPENDENCIES
824 /<i>\-D</i>
825 </pre>
826
827 <note>
828 The <c>\</c> is done to escape the <c>-</c> sign, which would normally be used
829 as part of a regular expression.
830 </note>
831
832 <p>
833 This will search the man page, and bring the searched item into focus:
834 </p>
835
836 <pre caption="Forward search results">
837 --deep (-D)
838 When used in conjunction with --update, this flag forces emerge to consider the entire
839 dependency tree of packages, instead of checking only the immediate dependencies of
840 the packages. As an example, this catches updates in libraries that are not directly
841 listed in the dependencies of a package.
842 </pre>
843
844 <p>
845 If you hit a search result by accident and want to continue searching for the
846 same results, simply press the <c>/</c> key again, and press enter (ie. don't
847 put a pattern it). This will cause the search to default to the last pattern
848 used. Now with some man pages, options are listed, then explained later on.
849 Take the <c>man 5 portage</c> man page. It lists the files used, then explains
850 their usage. Searching forward a few times would return the results, but
851 there's an easier way to handle this, with the second search form, backwards
852 searching. Let's use this to find the description on
853 <path>package.unmask</path>. First, bring up <c>man 5 portage</c>:
854 </p>
855
856 <pre caption="Bringing up the man 5 portage man page">
857 $ <i>man 5 portage</i>
858 </pre>
859
860 <p>
861 Now press <c>SHIFT+g</c>. This will bring you to the end of the page:
862 </p>
863
864 <pre caption="End of the man page after SHIFT+g">
865 SEE ALSO
866 emerge(1), ebuild(1), ebuild(5), make.conf(5)
867
868 Portage 2.0.51 Jan 2004 PORTAGE(5)
869 lines 418-442/442 (END)
870 </pre>
871
872 <p>
873 Now we'll go ahead and enter the pattern to search for with the <c>?pattern</c>
874 backwards search option. First press the <c>?</c> key to bring up the prompt,
875 and then enter in <c>package.unmask</c>, our query:
876 </p>
877
878 <pre caption="Specifying our search">
879 SEE ALSO
880 emerge(1), ebuild(1), ebuild(5), make.conf(5)
881
882 Portage 2.0.51 Jan 2004 PORTAGE(5)
883 ?<i>package.unmask</i>
884 </pre>
885
886 <p>
887 Then hit enter to bring up the result:
888 </p>
889
890 <pre caption="Our search result">
891 package.unmask
892 Just like package.mask above, except here you list packages you want to unmask.
893 Useful for overriding the global package.mask file (see below). Note that
894 this does not override packages that are masked via KEYWORDS.
895 ...
896 </pre>
897
898 <p>
899 And the search is complete! Note that just as with <c>/</c>, using <c>?</c>
900 search with no pattern will use the last pattern to search.
901 </p>
902
903 </body>
904 </section>
905 <section>
906 <title>Conclusion</title>
907 <body>
908
909 <p>
910 This concludes the man guide. This will hopefully shed some light on navigating
911 man pages, and maybe even give a few new tips to the more experienced users.
912 For those who prefer alternate means of navigating man pages, the following are
913 also avaliable:
914 </p>
915
916 <ul>
917 <li>app-text/man2html - a program for converting man pages to html</li>
918 <li>app-text/tkman - a tk based man page browser</li>
919 </ul>
920
921 <p>
922 Also the <c>KDE</c> web browser <c>Konqueror</c> can browse man pages using the
923 <c>man:</c> syntax in the address bar.
924 </p>
925
926 </body>
927 </section>
928 </chapter>
929 </guide>
930
931
932
933 --
934 gentoo-doc-cvs@g.o mailing list