03 July 2012

convert a man page into a web page (HTML)

Over the years, more ways of displaying and working with man pages have developed. For example, you can convert a man page into a web page (HTML) using the man2html command. For example:

$ whereis -m cat
cat: /usr/share/man/man1/cat.1.gz /usr/share/man/man1p/cat.1p.gz
$ cd /tmp ; cp /usr/share/man/man1/cat.1.gz .
$ gunzip cat.1.gz
$ man2html cat.1 > cat.1.html
$ links cat.1.html

The first command looks for the cat man page. The following commands copy that man page to the /tmp directory and unzip it. Next the man2html command converts the man page to HTML (cat.1.html file). The links command-line web browser then lets you view the webified man page from the shell. (You may need to install the elinks package to use the links or elinks text-based web browsers.)


See Also:





biOos

No comments: