https://wiki.archlinux.org/api.php?action=feedcontributions&user=Rtollert&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:22:46ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Man_page&diff=226346Man page2012-10-01T04:17:59Z<p>Rtollert: </p>
<hr />
<div>[[Category:System administration]]<br />
[[ko:Man Page]]<br />
[[ru:Man Page]]<br />
[[zh-CN:Man Page]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Information on man pages, along with recommendations on how to improve their usage}}<br />
<!--<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|}}<br />
--><br />
{{Article summary end}}<br />
<br />
'''Man pages''' (abbreviation for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial UNIX-like operating systems, including Arch Linux. The command used to display them is {{Ic|man}}.<br />
<br />
In spite of their scope, man pages are designed to be self-contained documents, consequentially limiting themselves to referring to other man pages when discussing related subjects. This is in sharp contrast with the hyperlink-aware info files, GNU's attempt at replacing the traditional man page format.<br />
<br />
==Accessing Man Pages==<br />
To read a man page, simply enter:<br />
<br />
$ man ''page_name''<br />
<br />
Manuals are sorted into several sections:<br />
# General commands<br />
# System calls (functions provided by the kernel)<br />
# Library calls (C library functions)<br />
# Special files (usually found in /dev) and drivers<br />
# File formats and conventions<br />
# Games<br />
# Miscellaneous (including conventions)<br />
# System administration commands (usually requiring root privileges) and daemons<br />
<br />
Man pages are usually referred to by their name, followed by their section number in parentheses. Often there are multiple man pages of the same name, such as man(1) and man(7). In this case, give man the section number followed by the name of the man page, for example:<br />
<br />
$ man 5 passwd<br />
<br />
to read the man page on {{Ic|/etc/passwd}}, rather than the {{Ic|passwd}} utility.<br />
<br />
Very brief descriptions of programs can be read out of man pages without displaying the whole page using the {{Ic|whatis}} command. For example, for a brief description of ls, type:<br />
<br />
$ whatis ls<br />
<br />
and {{Ic|whatis}} will output "list directory contents."<br />
<br />
==Format==<br />
Man pages all follow a fairly standard format, which helps in navigating them. Some sections which are often present include:<br />
* NAME - The name of the command and a one-line statement of its purpose.<br />
* SYNOPSIS - A list of the options and arguments a command takes or the parameters the function takes and its header file.<br />
* DESCRIPTION - A more in depth description of a command or function's purpose and workings.<br />
* EXAMPLES - Common examples, usually ranging from the simple to the relatively complex.<br />
* OPTIONS - Descriptions of each of the options a command takes and what they do.<br />
* EXIT STATUS - The meanings of different exit codes.<br />
* FILES - Files related to a command or function.<br />
* BUGS - Problems with the command or function that are pending repair. Also known as KNOWN BUGS.<br />
* SEE ALSO - A list of related commands or functions.<br />
* AUTHOR, HISTORY, COPYRIGHT, LICENSE, WARRANTY - Information about the program, its past, its terms of use, and its creator.<br />
<br />
==Searching manuals==<br />
Whilst the {{Ic|man}} utility allows users to display man pages, a problem arises when one knows not the exact name of the desired manual page in the first place! Fortunately, the {{Ic|-k}} or {{Ic|--apropos}} options can be used to search the manual page descriptions for instances of a given keyword.<br />
<br />
The research feature is provided by a dedicated cache. By default you may not have any cache built and all your searches will give you the ''nothing appropriate'' result. You can generate the cache or update it by running<br />
# mandb<br />
You should run it everytime a new manpage is installed.<br />
<br />
Now you can begin your search.<br />
For example, to search for man pages related to "password":<br />
<br />
$ man -k password<br />
<br />
or:<br />
<br />
$ man --apropos password<br />
<br />
This is equivalent to calling the {{Ic|apropos}} command:<br />
<br />
$ apropos password<br />
<br />
The given keyword is interpreted as a regular expression by default.<br />
<br />
If you want to do a more in-depth search by matching the keywords found in the whole articles, you can use the {{ic|-K}} option:<br />
$ man -K password<br />
<br />
==Colored man pages==<br />
Color-enabled man pages allow for a clearer presentation and easier digestion of the content.<br />
There are two prevalent methods for achieving colored man pages: using {{Ic|less}}, or opting for {{Ic|most}}.<br />
<br />
===First (recommended) method: using 'less'===<br />
:<small>''Source: [http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html nion's blog - less colors for man pages]''</small><br />
This method has the advantage that {{Ic|less}} has a bigger feature set than {{Ic|most}}, and is the default for viewing man pages.<br />
<br />
Add the following to a shell configuration file. For [[Bash]] it would be {{ic|~/.bashrc}}:<br />
<pre><br />
man() {<br />
env \<br />
LESS_TERMCAP_mb=$(printf "\e[1;31m") \<br />
LESS_TERMCAP_md=$(printf "\e[1;31m") \<br />
LESS_TERMCAP_me=$(printf "\e[0m") \<br />
LESS_TERMCAP_se=$(printf "\e[0m") \<br />
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \<br />
LESS_TERMCAP_ue=$(printf "\e[0m") \<br />
LESS_TERMCAP_us=$(printf "\e[1;32m") \<br />
man "$@"<br />
}<br />
</pre><br />
<br />
To customize the colors, see [[Wikipedia:ANSI escape code]] for reference.<br />
<br />
===Second (unrecommended) method: using 'most'===<br />
The basic function of 'most' is similar to {{Ic|less}} and {{Ic|more}}, but it has a smaller feature set. Configuring most to use colors is easier than using less, but additional configuration is necessary to make most behave like less.<br />
Install {{Pkg|most}} using [[pacman]]:<br />
# pacman -S most<br />
<br />
Edit {{ic|/etc/man_db.conf}}, uncomment the pager definition and change it to:<br />
DEFINE pager most -s<br />
Test the new setup by typing:<br />
$ man whatever_man_page<br />
<br />
Modifying the color values requires editing {{ic|~/.mostrc}} (creating the file if it is not present) or editing {{ic|/etc/most.conf}} for system-wide changes. Example {{ic|~/.mostrc}}:<br />
% Color settings<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
Another example showing keybindings similar to {{Ic|less}} (jump to line is set to 'J'):<br />
% less-like keybindings<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
=== Colored man pages on xterm or rxvt-unicode ===<br />
<br />
:<small>''Source:[http://pub.ligatura.org/fs/xfree86/xresources/xterm XFree resources file for XTerm program]''</small><br />
<br />
A quick way to add color to manual pages viewed on {{Pkg|xterm}}/{{Ic|uxterm}} or {{Pkg|rxvt-unicode}} can be made modifying the {{ic|~/.Xresources}} file.<br />
<br />
{{Note|If {{ic|~/.Xresources}} does not work for you, you can try using {{ic|~/.Xdefaults}}.}}<br />
<br />
Open that file in an editor and add this lines:<br />
<br />
(For xterm)<br />
*VT100.colorBDMode: true<br />
*VT100.colorBD: red<br />
*VT100.colorULMode: true<br />
*VT100.colorUL: cyan<br />
<br />
which ''replaces'' the decorations with the colors. Also add<br />
<br />
*VT100.veryBoldColors: 6<br />
<br />
if you want colors and decorations (bold or underline) ''at the same time''. See {{ic|man xterm}} for a description of the {{ic|veryBoldColors}} resource.<br />
<br />
(For rxvt-unicode)<br />
URxvt.colorIT: #87af5f<br />
URxvt.colorBD: #d7d7d7<br />
URxvt.colorUL: #87afd7<br />
<br />
Save and run:<br />
$ xrdb -load ~/.Xresources<br />
<br />
Launch a new {{Ic|xterm/uxterm}} or {{Ic|rxvt-unicode}} and you should see colorful man pages.<br />
This combination puts colors to '''bold''' and <u>underlined</u> words in {{Ic|xterm/uxterm}} or to '''bold''', <u>underlined</u>, and ''italicized'' text in {{Ic|rxvt-unicode}}. You can play with different combinations of these attributes (see the [http://pub.ligatura.org/fs/xfree86/xresources/xterm sources] of this item).<br />
<br />
==Reading man pages with a browser==<br />
Instead of the standard interface, using browsers such as [[lynx]] and [[Firefox]] to view man pages allows users to reap info pages' main benefit: hyperlinked text.<br />
Additionally, [[KDE]] users can read man pages in Konqueror using:<br />
man:<name><br />
<br />
===Using Local Man Pages===<br />
First, install {{AUR|man2html}} from the [[Arch User Repository|AUR]].<br />
<br />
Now, convert a man page:<br />
$ man free | man2html -compress -cgiurl man$section/$title.$section$subsection.html > ~/man/free.html<br />
<br />
Another use for {{Ic|man2html}} is exporting to raw, printer-friendly text:<br />
$ man free | man2html -bare > ~/free.txt<br />
<br />
The GNU implementation of man in the Arch repositories also has the ability to do this on its own:<br />
$ man -H free<br />
<br />
This will read your {{ic|BROWSER}} environment variable to determine the browser. You can override this by passing the binary to the {{ic|-H}} option.<br />
<br />
===Using Online Man Pages===<br />
There are several online databases of man pages, including:<br />
*[http://manpages.debian.net/ ''Debian GNU/Linux man pages'']<br />
*[http://leaf.dragonflybsd.org/cgi/web-man ''DragonFlyBSD manual pages'']<br />
*[http://www.freebsd.org/cgi/man.cgi ''FreeBSD Hypertext Man Pages'']<br />
*[http://www.manpages.spotlynx.com/ ''Linux and Solaris 10 Man Pages'']<br />
*[http://manpagehelp.net ''Linux/FreeBSD Man Pages''] with user comments<br />
*[http://linux.die.net/man/ ''Linux man pages at die.net'']<br />
*[http://www.kernel.org/doc/man-pages/ The Linux man-pages project at kernel.org]<br />
*[http://man-wiki.net/index.php/Main_Page Man-Wiki: ''Linux / Solaris / UNIX / BSD'']<br />
*[http://netbsd.gw.com/cgi-bin/man-cgi ''NetBSD manual pages'']<br />
*[http://developer.apple.com/documentation/Darwin/Reference/ManPages/index.html ''Mac OS X Manual Pages'']<br />
*[http://unixhelp.ed.ac.uk/alphabetical/index.html ''On-line UNIX manual pages'']<br />
*[http://www.openbsd.org/cgi-bin/man.cgi ''OpenBSD manual pages'']<br />
*[http://man.cat-v.org/plan_9/ ''Plan 9 Manual — Volume 1'']<br />
*[http://man.cat-v.org/inferno/ ''Inferno Manual — Volume 1'']<br />
*[http://sfdoccentral.symantec.com/sf/5.0MP3/linux/manpages/index.html ''Storage Foundation Man Pages'']<br />
*[http://www.unix.com/man-page/OpenSolaris/1/man/ ''The UNIX and Linux Forums Man Page Repository'']<br />
*[http://manpages.ubuntu.com/ ''Ubuntu Manpage Repository'']<br />
<br />
==Viewing man pages as PDFs==<br />
man pages have always been printable: they are written in troff, which is fundamentally a typesetting language. If you have ghostscript installed, converting a man page to PDF is actually very easy: {{ic|<nowiki>man -t <manpage> | ps2pdf - <pdf></nowiki>}}. [https://www.google.com/search?q=manpage+pdf+troff&num=100&hl=en&prmd=imvns&source=lnms&tbm=isch&sa=X&ei=5BZpUI3oH6rI2AXvx4CoAw&ved=0CAoQ_AUoAQ&biw=1321&bih=1100 This google image search] should give you an idea of what the result looks like; it may not be to everybody's liking.<br />
<br />
Caveats: Fonts are generally limited to Times at hardcoded sizes. There are no hyperlinks. Some man pages were specifically designed for terminal viewing, and won't look right in PS or PDF form.<br />
<br />
The following perl script converts man pages to PDFs, caches the PDFs in the {{ic|$HOME/.manpdf/}} directory, and calls a PDF viewer, specifically [http://www.archlinux.org/packages/community/x86_64/mupdf/ mupdf].<br />
<br />
{{hc|Usage: manpdf [<section>] <manpage>|<nowiki><br />
#!/usr/bin/perl<br />
use File::stat;<br />
<br />
$pdfdir = $ENV{"HOME"}."/.manpdf";<br />
-d $pdfdir || mkdir $pdfdir || die "can't create $pdfdir";<br />
$manpage = $ARGV[0];<br />
chop($manpath = `man -w $manpage`);<br />
die if $?;<br />
<br />
$maninfo = stat($manpath) or die;<br />
$manpath =~ s@.*/man./(.*)(\.(gz|bz2))?$@$1@;<br />
$pdfpath = "$pdfdir/$manpath.pdf";<br />
$pdftime = 0;<br />
if (-f $pdfpath) {<br />
$pdfinfo = stat($pdfpath) or die;<br />
$pdftime = $pdfinfo->mtime;<br />
}<br />
if (!-f $pdfpath || $maninfo->mtime > $pdftime) {<br />
system "man -t $manpage | ps2pdf -dPDFSETTINGS=/screen - $pdfpath";<br />
}<br />
die if !-f $pdfpath;<br />
if (!fork) {<br />
open(STDOUT, "/dev/null");<br />
open(STDERR, "/dev/null");<br />
exec "mupdf", "-r", "96", $pdfpath;<br />
#exec "acroread", $pdfpath;<br />
}<br />
</nowiki>}}<br />
<br />
==Noteworthy manpages==<br />
<br />
Here follows a non-exhaustive list of noteworthy pages that might help you understand a lot of things more in-depth. Some of them might serve as a good reference (like the ascii table).<br />
<br />
* ascii(7)<br />
* boot(7)<br />
* charsets(7)<br />
* chmod(1)<br />
* credentials(7)<br />
* fstab(5)<br />
* hier(7)<br />
* inittab(5)<br />
* locale(1P)(5)(7)<br />
* printf(3)<br />
* regex(7)<br />
* signal(7)<br />
* term(5)(7)<br />
* termcap(5)<br />
* terminfo(5)<br />
* utf-8(7)<br />
More generally, have a look at category 7 pages:<br />
man -s 7 -k ".*" <br />
<br />
Arch Linux specific pages:<br />
* archlinux(7)<br />
* mkinitcpio(8)<br />
* pacman(8)<br />
* pacman-key(8)<br />
* pacman.conf(5)<br />
* rc.conf(5)</div>Rtollerthttps://wiki.archlinux.org/index.php?title=Man_page&diff=226345Man page2012-10-01T04:17:02Z<p>Rtollert: </p>
<hr />
<div>[[Category:System administration]]<br />
[[ko:Man Page]]<br />
[[ru:Man Page]]<br />
[[zh-CN:Man Page]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Information on man pages, along with recommendations on how to improve their usage}}<br />
<!--<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|}}<br />
--><br />
{{Article summary end}}<br />
<br />
'''Man pages''' (abbreviation for "manual pages") are the extensive documentation that comes preinstalled with almost all substantial UNIX-like operating systems, including Arch Linux. The command used to display them is {{Ic|man}}.<br />
<br />
In spite of their scope, man pages are designed to be self-contained documents, consequentially limiting themselves to referring to other man pages when discussing related subjects. This is in sharp contrast with the hyperlink-aware info files, GNU's attempt at replacing the traditional man page format.<br />
<br />
==Accessing Man Pages==<br />
To read a man page, simply enter:<br />
<br />
$ man ''page_name''<br />
<br />
Manuals are sorted into several sections:<br />
# General commands<br />
# System calls (functions provided by the kernel)<br />
# Library calls (C library functions)<br />
# Special files (usually found in /dev) and drivers<br />
# File formats and conventions<br />
# Games<br />
# Miscellaneous (including conventions)<br />
# System administration commands (usually requiring root privileges) and daemons<br />
<br />
Man pages are usually referred to by their name, followed by their section number in parentheses. Often there are multiple man pages of the same name, such as man(1) and man(7). In this case, give man the section number followed by the name of the man page, for example:<br />
<br />
$ man 5 passwd<br />
<br />
to read the man page on {{Ic|/etc/passwd}}, rather than the {{Ic|passwd}} utility.<br />
<br />
Very brief descriptions of programs can be read out of man pages without displaying the whole page using the {{Ic|whatis}} command. For example, for a brief description of ls, type:<br />
<br />
$ whatis ls<br />
<br />
and {{Ic|whatis}} will output "list directory contents."<br />
<br />
==Format==<br />
Man pages all follow a fairly standard format, which helps in navigating them. Some sections which are often present include:<br />
* NAME - The name of the command and a one-line statement of its purpose.<br />
* SYNOPSIS - A list of the options and arguments a command takes or the parameters the function takes and its header file.<br />
* DESCRIPTION - A more in depth description of a command or function's purpose and workings.<br />
* EXAMPLES - Common examples, usually ranging from the simple to the relatively complex.<br />
* OPTIONS - Descriptions of each of the options a command takes and what they do.<br />
* EXIT STATUS - The meanings of different exit codes.<br />
* FILES - Files related to a command or function.<br />
* BUGS - Problems with the command or function that are pending repair. Also known as KNOWN BUGS.<br />
* SEE ALSO - A list of related commands or functions.<br />
* AUTHOR, HISTORY, COPYRIGHT, LICENSE, WARRANTY - Information about the program, its past, its terms of use, and its creator.<br />
<br />
==Searching manuals==<br />
Whilst the {{Ic|man}} utility allows users to display man pages, a problem arises when one knows not the exact name of the desired manual page in the first place! Fortunately, the {{Ic|-k}} or {{Ic|--apropos}} options can be used to search the manual page descriptions for instances of a given keyword.<br />
<br />
The research feature is provided by a dedicated cache. By default you may not have any cache built and all your searches will give you the ''nothing appropriate'' result. You can generate the cache or update it by running<br />
# mandb<br />
You should run it everytime a new manpage is installed.<br />
<br />
Now you can begin your search.<br />
For example, to search for man pages related to "password":<br />
<br />
$ man -k password<br />
<br />
or:<br />
<br />
$ man --apropos password<br />
<br />
This is equivalent to calling the {{Ic|apropos}} command:<br />
<br />
$ apropos password<br />
<br />
The given keyword is interpreted as a regular expression by default.<br />
<br />
If you want to do a more in-depth search by matching the keywords found in the whole articles, you can use the {{ic|-K}} option:<br />
$ man -K password<br />
<br />
==Colored man pages==<br />
Color-enabled man pages allow for a clearer presentation and easier digestion of the content.<br />
There are two prevalent methods for achieving colored man pages: using {{Ic|less}}, or opting for {{Ic|most}}.<br />
<br />
===First (recommended) method: using 'less'===<br />
:<small>''Source: [http://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html nion's blog - less colors for man pages]''</small><br />
This method has the advantage that {{Ic|less}} has a bigger feature set than {{Ic|most}}, and is the default for viewing man pages.<br />
<br />
Add the following to a shell configuration file. For [[Bash]] it would be {{ic|~/.bashrc}}:<br />
<pre><br />
man() {<br />
env \<br />
LESS_TERMCAP_mb=$(printf "\e[1;31m") \<br />
LESS_TERMCAP_md=$(printf "\e[1;31m") \<br />
LESS_TERMCAP_me=$(printf "\e[0m") \<br />
LESS_TERMCAP_se=$(printf "\e[0m") \<br />
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \<br />
LESS_TERMCAP_ue=$(printf "\e[0m") \<br />
LESS_TERMCAP_us=$(printf "\e[1;32m") \<br />
man "$@"<br />
}<br />
</pre><br />
<br />
To customize the colors, see [[Wikipedia:ANSI escape code]] for reference.<br />
<br />
===Second (unrecommended) method: using 'most'===<br />
The basic function of 'most' is similar to {{Ic|less}} and {{Ic|more}}, but it has a smaller feature set. Configuring most to use colors is easier than using less, but additional configuration is necessary to make most behave like less.<br />
Install {{Pkg|most}} using [[pacman]]:<br />
# pacman -S most<br />
<br />
Edit {{ic|/etc/man_db.conf}}, uncomment the pager definition and change it to:<br />
DEFINE pager most -s<br />
Test the new setup by typing:<br />
$ man whatever_man_page<br />
<br />
Modifying the color values requires editing {{ic|~/.mostrc}} (creating the file if it is not present) or editing {{ic|/etc/most.conf}} for system-wide changes. Example {{ic|~/.mostrc}}:<br />
% Color settings<br />
color normal lightgray black<br />
color status yellow blue<br />
color underline yellow black<br />
color overstrike brightblue black<br />
Another example showing keybindings similar to {{Ic|less}} (jump to line is set to 'J'):<br />
% less-like keybindings<br />
unsetkey "^K"<br />
unsetkey "g"<br />
unsetkey "G"<br />
unsetkey ":"<br />
<br />
setkey next_file ":n"<br />
setkey find_file ":e"<br />
setkey next_file ":p"<br />
setkey toggle_options ":o"<br />
setkey toggle_case ":c"<br />
setkey delete_file ":d"<br />
setkey exit ":q"<br />
<br />
setkey bob "g"<br />
setkey eob "G"<br />
setkey down "e"<br />
setkey down "E"<br />
setkey down "j"<br />
setkey down "^N"<br />
setkey up "y"<br />
setkey up "^Y"<br />
setkey up "k"<br />
setkey up "^P"<br />
setkey up "^K"<br />
setkey page_down "f"<br />
setkey page_down "^F"<br />
setkey page_up "b"<br />
setkey page_up "^B"<br />
setkey other_window "z"<br />
setkey other_window "w"<br />
setkey search_backward "?"<br />
setkey bob "p"<br />
setkey goto_mark "'"<br />
setkey find_file "E"<br />
setkey edit "v"<br />
<br />
=== Colored man pages on xterm or rxvt-unicode ===<br />
<br />
:<small>''Source:[http://pub.ligatura.org/fs/xfree86/xresources/xterm XFree resources file for XTerm program]''</small><br />
<br />
A quick way to add color to manual pages viewed on {{Pkg|xterm}}/{{Ic|uxterm}} or {{Pkg|rxvt-unicode}} can be made modifying the {{ic|~/.Xresources}} file.<br />
<br />
{{Note|If {{ic|~/.Xresources}} does not work for you, you can try using {{ic|~/.Xdefaults}}.}}<br />
<br />
Open that file in an editor and add this lines:<br />
<br />
(For xterm)<br />
*VT100.colorBDMode: true<br />
*VT100.colorBD: red<br />
*VT100.colorULMode: true<br />
*VT100.colorUL: cyan<br />
<br />
which ''replaces'' the decorations with the colors. Also add<br />
<br />
*VT100.veryBoldColors: 6<br />
<br />
if you want colors and decorations (bold or underline) ''at the same time''. See {{ic|man xterm}} for a description of the {{ic|veryBoldColors}} resource.<br />
<br />
(For rxvt-unicode)<br />
URxvt.colorIT: #87af5f<br />
URxvt.colorBD: #d7d7d7<br />
URxvt.colorUL: #87afd7<br />
<br />
Save and run:<br />
$ xrdb -load ~/.Xresources<br />
<br />
Launch a new {{Ic|xterm/uxterm}} or {{Ic|rxvt-unicode}} and you should see colorful man pages.<br />
This combination puts colors to '''bold''' and <u>underlined</u> words in {{Ic|xterm/uxterm}} or to '''bold''', <u>underlined</u>, and ''italicized'' text in {{Ic|rxvt-unicode}}. You can play with different combinations of these attributes (see the [http://pub.ligatura.org/fs/xfree86/xresources/xterm sources] of this item).<br />
<br />
==Reading man pages with a browser==<br />
Instead of the standard interface, using browsers such as [[lynx]] and [[Firefox]] to view man pages allows users to reap info pages' main benefit: hyperlinked text.<br />
Additionally, [[KDE]] users can read man pages in Konqueror using:<br />
man:<name><br />
<br />
===Using Local Man Pages===<br />
First, install {{AUR|man2html}} from the [[Arch User Repository|AUR]].<br />
<br />
Now, convert a man page:<br />
$ man free | man2html -compress -cgiurl man$section/$title.$section$subsection.html > ~/man/free.html<br />
<br />
Another use for {{Ic|man2html}} is exporting to raw, printer-friendly text:<br />
$ man free | man2html -bare > ~/free.txt<br />
<br />
The GNU implementation of man in the Arch repositories also has the ability to do this on its own:<br />
$ man -H free<br />
<br />
This will read your {{ic|BROWSER}} environment variable to determine the browser. You can override this by passing the binary to the {{ic|-H}} option.<br />
<br />
===Using Online Man Pages===<br />
There are several online databases of man pages, including:<br />
*[http://manpages.debian.net/ ''Debian GNU/Linux man pages'']<br />
*[http://leaf.dragonflybsd.org/cgi/web-man ''DragonFlyBSD manual pages'']<br />
*[http://www.freebsd.org/cgi/man.cgi ''FreeBSD Hypertext Man Pages'']<br />
*[http://www.manpages.spotlynx.com/ ''Linux and Solaris 10 Man Pages'']<br />
*[http://manpagehelp.net ''Linux/FreeBSD Man Pages''] with user comments<br />
*[http://linux.die.net/man/ ''Linux man pages at die.net'']<br />
*[http://www.kernel.org/doc/man-pages/ The Linux man-pages project at kernel.org]<br />
*[http://man-wiki.net/index.php/Main_Page Man-Wiki: ''Linux / Solaris / UNIX / BSD'']<br />
*[http://netbsd.gw.com/cgi-bin/man-cgi ''NetBSD manual pages'']<br />
*[http://developer.apple.com/documentation/Darwin/Reference/ManPages/index.html ''Mac OS X Manual Pages'']<br />
*[http://unixhelp.ed.ac.uk/alphabetical/index.html ''On-line UNIX manual pages'']<br />
*[http://www.openbsd.org/cgi-bin/man.cgi ''OpenBSD manual pages'']<br />
*[http://man.cat-v.org/plan_9/ ''Plan 9 Manual — Volume 1'']<br />
*[http://man.cat-v.org/inferno/ ''Inferno Manual — Volume 1'']<br />
*[http://sfdoccentral.symantec.com/sf/5.0MP3/linux/manpages/index.html ''Storage Foundation Man Pages'']<br />
*[http://www.unix.com/man-page/OpenSolaris/1/man/ ''The UNIX and Linux Forums Man Page Repository'']<br />
*[http://manpages.ubuntu.com/ ''Ubuntu Manpage Repository'']<br />
<br />
==Viewing man pages as PDFs==<br />
man pages have always been printable: they are written in troff, which is fundamentally a typesetting language. If you have ghostscript installed, converting a man page to PDF is actually very easy: {{ic|man -t <manpage> | ps2pdf - <pdf>}}. [https://www.google.com/search?q=manpage+pdf+troff&num=100&hl=en&prmd=imvns&source=lnms&tbm=isch&sa=X&ei=5BZpUI3oH6rI2AXvx4CoAw&ved=0CAoQ_AUoAQ&biw=1321&bih=1100 This google image search] should give you an idea of what the result looks like; it may not be to everybody's liking.<br />
<br />
Caveats: Fonts are generally limited to Times at hardcoded sizes. There are no hyperlinks. Some man pages were specifically designed for terminal viewing, and won't look right in PS or PDF form.<br />
<br />
The following perl script converts man pages to PDFs, caches the PDFs in the {{ic|$HOME/.manpdf/}} directory, and calls a PDF viewer, specifically [http://www.archlinux.org/packages/community/x86_64/mupdf/ mupdf].<br />
<br />
{{hc|Usage: manpdf [<section>] <manpage>|<nowiki><br />
#!/usr/bin/perl<br />
use File::stat;<br />
<br />
$pdfdir = $ENV{"HOME"}."/.manpdf";<br />
-d $pdfdir || mkdir $pdfdir || die "can't create $pdfdir";<br />
$manpage = $ARGV[0];<br />
chop($manpath = `man -w $manpage`);<br />
die if $?;<br />
<br />
$maninfo = stat($manpath) or die;<br />
$manpath =~ s@.*/man./(.*)(\.(gz|bz2))?$@$1@;<br />
$pdfpath = "$pdfdir/$manpath.pdf";<br />
$pdftime = 0;<br />
if (-f $pdfpath) {<br />
$pdfinfo = stat($pdfpath) or die;<br />
$pdftime = $pdfinfo->mtime;<br />
}<br />
if (!-f $pdfpath || $maninfo->mtime > $pdftime) {<br />
system "man -t $manpage | ps2pdf -dPDFSETTINGS=/screen - $pdfpath";<br />
}<br />
die if !-f $pdfpath;<br />
if (!fork) {<br />
open(STDOUT, "/dev/null");<br />
open(STDERR, "/dev/null");<br />
exec "mupdf", "-r", "96", $pdfpath;<br />
#exec "acroread", $pdfpath;<br />
}<br />
</nowiki>}}<br />
<br />
==Noteworthy manpages==<br />
<br />
Here follows a non-exhaustive list of noteworthy pages that might help you understand a lot of things more in-depth. Some of them might serve as a good reference (like the ascii table).<br />
<br />
* ascii(7)<br />
* boot(7)<br />
* charsets(7)<br />
* chmod(1)<br />
* credentials(7)<br />
* fstab(5)<br />
* hier(7)<br />
* inittab(5)<br />
* locale(1P)(5)(7)<br />
* printf(3)<br />
* regex(7)<br />
* signal(7)<br />
* term(5)(7)<br />
* termcap(5)<br />
* terminfo(5)<br />
* utf-8(7)<br />
More generally, have a look at category 7 pages:<br />
man -s 7 -k ".*" <br />
<br />
Arch Linux specific pages:<br />
* archlinux(7)<br />
* mkinitcpio(8)<br />
* pacman(8)<br />
* pacman-key(8)<br />
* pacman.conf(5)<br />
* rc.conf(5)</div>Rtollert