Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to "colorize" manpages output? I mean - the output of for example:

man command_name
share|improve this question
up vote 5 down vote accepted

I use the following shell function to view manpages in Vim, which provides nice syntax highlighing:

man() {
  /usr/bin/man $* | \
    col -b | \
    vim -R -c 'set ft=man nomod nolist' -
share|improve this answer
and finally I won't be pressing j by mistake all the time – daithib8 Apr 18 '11 at 16:24
Well, j works fine in less as well :) – Adam Byrtek Apr 18 '11 at 16:26
But you should change $* to "$@" to avoid potential problems with white space. Otherwise, thanks a bunch! – Scott Severance Apr 21 '11 at 13:09
I suggest a little modification, to get more close to less style: substitute vim with /usr/share/vim/vim72/macros/ – enzotib Apr 25 '11 at 9:07

aha. adding this to ~/.bashrc does the trick. It's not perfect though. but hey:

# Less Colors for Man Pages 
export LESS_TERMCAP_mb=$'\E[01;31m'       # begin blinking 
export LESS_TERMCAP_md=$'\E[01;38;5;74m'  # begin bold 
export LESS_TERMCAP_me=$'\E[0m'           # end mode 
export LESS_TERMCAP_se=$'\E[0m'           # end standout-mode 
export LESS_TERMCAP_so=$'\E[38;5;246m'    # begin standout-mode - info box 
export LESS_TERMCAP_ue=$'\E[0m'           # end underline 
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
share|improve this answer
Why man pages in virtual terminal have a minimum of color (cyan for bold), and in graphic terminal are black and white? – enzotib Apr 18 '11 at 7:01

add export PAGER=most to .bashrc

share|improve this answer
this is great, but is there a way to make it work for HELP and INFO commands ? – ALJI Mohamed May 27 at 8:56

Does it have to be in the terminal?

Else you can use: System->Help->System Documentation and on the left of the window that comes up click "Manual Pages" (found this tip here)

Or you can use Konqueror, which shows the man pages like this: Man page in Konqueror

share|improve this answer
wow. didn't know one can do that. – Stann May 24 '11 at 15:12
Does any other browser support this? – udiboy1209 Apr 7 '14 at 5:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.