Monday, January 26, 2009

Colorful man pages in Linux - ubuntu tips


By default, the man pages are formatted using Linux 'less' utility which displays the texts in blank and white colors. Using 'most' utility to view man pages gives a color formatted man page, something like below



Now the ways to install 'most' utility and making it default for viewing the man pages in your Linux box:

Install most
$ sudo apt-get install most

Make it default for man page viewer:
$ sudo update-alternatives --config pager

The above command will list the alternatives which provide 'pager'. You can make 'most' as default by pressing the corresponding selection number for it.

And you are done. Now try to view a man page of a command.

Give a try and enjoy colorful man pages on your ubuntu.

For the newbies:
apt-get - APT package handling utility -- command-line interface
most - browse or page through a text file
update-alternatives - maintain symbolic links determining default commands

Related post:
- Enable color support for Linux ls command

8 comments:

der bronsen said...

Thanks for this tip!

And even though this is about bash scripting: it also works in zsh. :)

Unknown said...

@housetier, thanks for commenting. :-)

Boby Thomas said...

Cool collection...keep it up.

Regards,
Boby

www.bobsindia.com

Anonymous said...

See http://grbzks.blogspot.com/2008/10/colored-man-pages-with-less.html :)

David Tangye said...

Excellent tip, thanks.

kezesb said...

You may also check out the vimpager script, though it needs a puny modification to make sure it works a heavily modified vimrc.

Unknown said...

This method has the advantage that less has a bigger feature set than most, and is the default for viewing man pages ...

https://wiki.archlinux.org/index.php/Man_Page#Second_.28unrecommended.29_method:_using_.27most.27

Unknown said...

@cayetano santos, thanks for the info, its useful.

© Jadu Saikia www.UNIXCL.com