Is it possible, and if so how, to have colour/bold/italic characters in
man pages while using
Not quite the answer you were looking for, but it might be a better one.
mandb is an implementation of
man that will format man pages in HTML. It was written by someone at Redhat and is I think now the standard on all
.rpm based systems, but available to install as a replacement for the old man on Debian, Ubuntu, et. al.
man -H whatever will format the page in HTML and send it to
$BROWSER. There are a few man pages where this goes screwy (such as
gcc), but most of them are fine. It's also sometimes problematic with
That's a great feature, but most of the time I can't be bothered -- I'd rather just glance through the page in a terminal. Thanks to
lynx, a text mode web browser, you can sort of get the best of both worlds. I don't want
$BROWSER to be lynx generally, so:
#!/bin/bash BROWSER=lynx man -H $@
And call this
mnlx or something.
mandb creates a tmp file to do this, so you could speed things up by caching the HTML versions and using those when available -- but that's a longer script...
The really nice thing about this is
mandb also adds an index with links to each section at the top, e.g.:
BASH BASH (p1 of 121) NAME SYNOPSIS COPYRIGHT DESCRIPTION OPTIONS ARGUMENTS INVOCATION DEFINITIONS RESERVED WORDS SHELL GRAMMAR COMMENTS QUOTING PARAMETERS EXPANSION REDIRECTION ALIASES FUNCTIONS [...]
The man page proper follows this. As manatwork indicates in the comments, italic and bold appear as red and (bold) blue in lynx; normal text is white, links are green, the current link is bold yellow.