13

When I switched to tty I noticed manpages look different by using some color scheme. How to make it to gnome-terminal?

Update: Here is a solution, I found at Unix stackExchange site.

2
  • This question is very vague. What are you asking?
    – jackweirdy
    Jun 26, 2012 at 19:33
  • I guess what you are asking is coloured like pattern in normal gnome terminal.
    – atenz
    Jun 26, 2012 at 20:48

5 Answers 5

10

I didn't know it, but I found something here:
http://www.tuxarena.com/2012/04/tutorial-colored-man-pages-how-it-works/

Instructions from the above link:

Edit your .bashrc file and add the following lines:

export LESS_TERMCAP_mb=$(printf '\e[01;31m') # enter blinking mode - red
export LESS_TERMCAP_md=$(printf '\e[01;35m') # enter double-bright mode - bold, magenta
export LESS_TERMCAP_me=$(printf '\e[0m') # turn off all appearance modes (mb, md, so, us)
export LESS_TERMCAP_se=$(printf '\e[0m') # leave standout mode    
export LESS_TERMCAP_so=$(printf '\e[01;33m') # enter standout mode - yellow
export LESS_TERMCAP_ue=$(printf '\e[0m') # leave underline mode
export LESS_TERMCAP_us=$(printf '\e[04;36m') # enter underline mode - cyan

Next, start a new terminal session or enter the command source ~./bashrc in your current terminal.

0
10

You can have coloured man pages using the following commands:

sudo apt-get install most
export PAGER="most"  

Now check your man pages by

man ls

enter image description here

3
  • 1
    If you only want to use most as the pager for man then you can alias this via alias man="man -P most". Sep 23, 2014 at 22:59
  • 1
    @DrewNoakes or set MANPAGER instead of PAGER.
    – muru
    Dec 9, 2016 at 2:24
  • If you only want to use most for its colouring of man pages, I'd suggest that you just setup colours for less instead.
    – Tom Hale
    Dec 9, 2016 at 2:40
2

Without needing to install most, you can configure less to look like this:

Coloured man page example

Add the following in your `~.bashrc':

# Have less display colours
# from: https://wiki.archlinux.org/index.php/Color_output_in_console#man
export LESS_TERMCAP_mb=$'\e[1;31m'     # begin bold
export LESS_TERMCAP_md=$'\e[1;33m'     # begin blink
export LESS_TERMCAP_so=$'\e[01;44;37m' # begin reverse video
export LESS_TERMCAP_us=$'\e[01;37m'    # begin underline
export LESS_TERMCAP_me=$'\e[0m'        # reset bold/blink
export LESS_TERMCAP_se=$'\e[0m'        # reset reverse video
export LESS_TERMCAP_ue=$'\e[0m'        # reset underline
2

If you use Oh My Zsh you can add colored-man-pages to the plugins array of your .zshrc file.

0

One possible way would be a manual one by Going through the Edit menu of Gnome Terminal in Menu Bar , then In Profile Preferences as here in image. You can try and play around to suite your needs.

enter image description here

Another is a process explained here.Though explained for 11.04 version , check out its homepage for further info.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .