Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I'm using CentOS 4.8. I like the grey background color and the black foreground color,by which my eyes wouldn't sore.

when I set 'export PS1="\e[0;30m\e[47m\u@\h \w>"' , It only changes the bash prompt line colors.

When I'm editing text via 'vi' or looking up information via 'info',the colors are back to default.

So I'm wondering how to change the background and foreground color globally. thanks for any tip.


My CentOS is server version, so there is no gui interface.

share|improve this question

migrated from Dec 17 '09 at 4:04

This question came from our site for professional and enthusiast programmers.

In the old days, there were several hundred options you could set in your .Xdefaults to customize an xterm. Now it's probably in drop down menus or something boring like that. – Paul Tomblin Dec 17 '09 at 2:56
What terminal application are you using? It's different for different terminals. – ZoogieZork Dec 17 '09 at 2:57
thanks for your replies.I forget to say that I'm using the server version CentOS. – Anonymous Dec 17 '09 at 3:08
You don't say whether you're on the console, using xterm, using something like PuTTY, or if you're using Gnome or KDE and one of their terminals, etc. – Dennis Williamson Dec 17 '09 at 3:59

The terminal color is set by a flag on the xterm command (if you're running X of course):

-bg color
This option specifies the color to use for the background of the window. The default is ''XtDefaultBackground.''

-fg color
This option specifies the color to use for displaying text. The default is ''XtDefaultForeground.''
-fn font
share|improve this answer

Gnome Terminal picks up the background colour from the profile in use, so any change will impact the background colour of all terminals using the same profile. The configuration key is stored in /apps/gnome-terminal/profiles/Default/background_color, where Default is the currently used profile. I have demonstrated it in below code.

  1. Open the file named %gconf.xml under */apps/gnome-terminal/profiles/Default
  2. Change the background and foreground colour accordingly.

     <?xml version="1.0"?>
      <entry name="use_theme_colors" mtime="1401108737" type="bool" value="false"/>
      <entry name="visible_name" mtime="1401108737" type="string">
    <entry name="palette" mtime="1401108737" type="string">
    <entry name="background_color" mtime="1401108737" type="string">
    <entry name="foreground_color" mtime="1401108737" type="string">
    <entry name="bold_color" mtime="1401108737" type="string">

share|improve this answer

Your Answer


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