Please feel free to email me with any questions at with "blog" as the subject.

Search my blog:

Loading...

Tuesday, 7 September 2010

Change TTY text and background colour.

Change TTY text and background colour.

I recently found a way to change the colour of the text in the TTY screens which is kinda neat if you use them a lot. I use TTY's all the time to manage my servers.

The command is setterm.

The two variables for colour change are -foreground and -background.

Here are the possibilities from the help dialogue:

bash$ [ -foreground black|blue|green|cyan|red|magenta|yellow|white|default ]
bash$ [ -background black|blue|green|cyan|red|magenta|yellow|white|default ]

The usage for this command is as follows:

bash$ setterm -background [colour] -foreground [colour]

For instance for a green on black theme I would use:

bash$ setterm -background black -foreground green

and if the background was already black you could just use:

bash$ setterm -foreground green


If you want this to happen every time you log in you could add it to your .bashrc otherwise you need to manually do this every time you log in to a TTY.