I've seen setterm suggested, but it did nothing I've seen suggestions based on ansi esc characters , doesnt last I think the prompt resets any color changes, so I can echo a color change to print a word, but I can't it get it to maintain the color set, I went to the terminal preference, selected foreground as green, nothing happened Specifically $ setterm -foreground green Nothing happened

There has to be an easier way to set the terminal colors, I haven't found it Any suggestions


You can control the colour scheme using the .bashrc file located in your home directory. Look for the colour prompt settings, there should be some lines starting with PS1. Editing that line will allow you to customize your terminal session. A guide can be found here. https://www.tecmint.com/customize-bash-colors-terminal-prompt-linux/

Note: any changes you make to the .bashrc file will only take effect on a NEW terminal session. So if sshing in you would have to disconnect and reconnect or close the terminal and reopen if using via a monitor.

  • Again , I'm looking to change the whole screen terminal , not just the prompt $ps1
    – jim Cruse
    Apr 11 '19 at 11:14

I assume by 'terminal' you mean a terminal emulator (gnome-terminal, xfce4-terminal, xterm, etc.). In this case you can usually modify/change the terminal 16 main color palette, somewhere in the Preference/Setting menus of the terminal emulator application itself. When you are happy with the color palette you can use the color codes to reference them for output/prompts (refer to this link here for more info on the color codes).

With that info in mind, you can use something like this prompt generator tool to generate a colored prompt to your liking. Keep in mind that the colors used in that link are simply color code references and they will look different depending on the terminal palette.

If by 'terminal' you meant the virtual console (usually accessible through CTRL-ALT-F[1-7]), then have a look at:
How can I change the TTY colors?
Linux console


The following will works to apply a given color to both the background and text, not permanently:

First of all the raspberry terminal support only 8 colors.

Color codes:

Black:   30     40
Red:     31     41
Green:   32     42
Yellow:  33     43
Blue:    34     44
Magenta: 35     45
Cyan:    36     46
White:   37     47
Grey     5      5
Bold     1

To echo an escape sequence with the keyboard:

echo '



Example display, run the program ifconfig with the pink font and blue background:

You can't copy paste this command,it won't work, you must generate the escape sequence with the keyboard shortcut, or use some longer versions for escaping.

echo '^[[35;44mlol' ; ifconfig


Find further ANSI colors details

Further infos about PS1

Further infos about BASH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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