Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

in my gnome terminal i can change the profile preferences to set the text color to green. i'm not talking about the prompt (this is already set up in blue how i want it) just talking about the general text color when i run commands like echo for example. What should i add to my .bashrc file to do this for the linux terminals? (eg. for the ctrl+alt+f1 terminal) i want green text.

i am running debian 7.

share|improve this question
    
this question may hold the answer –  mulllhausen Sep 26 '13 at 13:34
add comment

2 Answers

this .bashrc comes close but is still not quite right:

black_foreground=30
red_foreground=31
green_foreground=32
yellow_foreground=33
blue_foreground=34
magenta_foreground=35
cyan_foreground=36
white_foreground=37

black_background=40
red_background=41
green_background=42
yellow_background=43
blue_background=44
magenta_background=45
cyan_background=46
white_background=47

reset_color=0

normal_chars=0
bold_chars=1
underlined_chars=4
blinking_chars=5
reverse_chars=7

start_prompt_coloring="\e[${bold_chars};${cyan_foreground}m"
end_prompt_coloring="\e[0m"
start_text_coloring="\e[${green_foreground}m"
PS1="${start_prompt_coloring}[\u@\h \W] \$${end_prompt_coloring} ${start_text_coloring}"

this gives the desired green text up until i run a command such as ls -l --color=auto which is colored, and then the ls command sets its own white color for that command only:

sample bash terminal with colored text

i do not want the output of ls -l to be white (white is the current terminal default) - i want to change the default terminal text to green. please provide a better answer if you know one!

share|improve this answer
add comment
up vote 0 down vote accepted

put this in ~/.bashrc:

# set the default text color. this only works in tty (eg $TERM == "linux"), not pts (eg $TERM == "xterm")
setterm -background black -foreground green -store
share|improve this answer
add comment

Your Answer

 
discard

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

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