0

I see the man page options very dark. I use the konsole terminal in Kubuntu. I want to change the colour, how can I do it.

The solution that I've found only works until shutdown. The terminal responds to the first command with: "No such file or directory"

  • brutal tip: If you want a bash command be done every startup, is enough to write it in /etc/rc.local cheer – feligiotti Oct 09 '14 at 13:15
  • @gio900 it doesn't work for me. Can you tell me where do I have to copy it exactly inside that file? –  Oct 09 '14 at 15:26
  • that file work as root, so use it with ~ instead of the absolute path isn't the best idea. But... wait! Why don't import just a different colors schema to the Konsole? https://github.com/nareshv/kde-konsole-colorschemes – feligiotti Oct 09 '14 at 15:53
  • I wrote the command with absolute path I think: sudo vi /etc/rc.local then just above the last line (exit 0) I copied all that code. Could you make an answer and explain how to import a color schema of those? And what do represent all that numbers in the terminal pictures. Another question: if I write sudo -s in rc.local y will be root every time I open the terminal? Thank you. –  Oct 10 '14 at 08:24
  • I was able to change the color of the options by changing all the colors editing the profile. But I don't know what represents each color (I do know what are foreground and background but I don't know what represents the 1-8 colors) –  Oct 10 '14 at 10:31
  • nether me know the colors options meaning, you shall try or ask someone else. To let an user do root command without use psw, look here: http://askubuntu.com/questions/159007/how-do-i-run-specific-sudo-commands-without-a-password NB 1 is not a good idea do every command in bash as root, 2 the ~ is a relative path: means /home/youruserdirectory, so if you write ~ in the /etc/rc.local file,so as root, that relative path means /root.Also, if you create a file/directory as root you have to ask yourself if is better change the howner of it by chown. Use man chown to see how it work.Cheers – feligiotti Oct 10 '14 at 11:14

1 Answers1

1

You can change the color of your man page by adding following line in your .bashrc file.

man() {
    env LESS_TERMCAP_md=$'\e[1;32m' \
    man "$@"
}

Here LESS_TERMCAP_md is for man bold letter. (man by default uses less to display page.)

Replace the color code \e[1;32m with desired one. you can find these color code here

enter image description here

g_p
  • 18,504
  • I opened the .bashrc file with Kate. I wrote that at the end of the file and saved it. Then I wrote man sudo in the terminal, and didn't notice any change. –  Oct 06 '14 at 10:41
  • Try to change color from the terminal profile. In gnome-terminal, right click in terminal, select profile -> profile preferences -> color – g_p Oct 06 '14 at 10:45
  • Oh I think there is a confusion. I'm using the konsole terminal in kubuntu. Should have written it down. I found the solution here http://unix.stackexchange.com/questions/119/colors-in-man-pages –  Oct 06 '14 at 11:28