Ask Your Question
0

how to change colour of [username@computer dir]?

asked 2016-11-10 04:17:12 -0500

TheSpanishInquisition gravatar image

I would like to know how I can change the colour of [usernam@computer dir] in terminal?

edit retag flag offensive close merge delete

Comments

florian gravatar imageflorian ( 2016-11-10 13:23:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-11-10 13:21:58 -0500

florian gravatar image

Check: http://www.cyberciti.biz/faq/bash-she...

tl;dr

To set a red color prompt, type the following command:

export PS1="\e[0;31m[\u@\h \W]\$ \e[m "

where:

\e[ : Start color scheme.
x;y : Color pair to use (x;y)
$PS1 : Your shell prompt variable.
\e[m : Stop color scheme.

List of color codes:

Black 0;30 Blue 0;34 Green 0;32 Cyan 0;36 Red 0;31 Purple 0;35 Brown 0;33 Blue 0;34 Green 0;32 Cyan 0;36 Red 0;31 Purple 0;35 Brown 0;33

Note: You need to replace digit 0 with 1 to get light color version.

KUDOS to author of original article

edit flag offensive delete link more

Comments

it worked, thanks!

TheSpanishInquisition gravatar imageTheSpanishInquisition ( 2016-11-14 08:38:48 -0500 )edit

Question Tools

Stats

Asked: 2016-11-10 04:17:12 -0500

Seen: 128 times

Last updated: Nov 10 '16