1
I'm trying to change the color of my shell which I connect to using Putty.
When I type this
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h:\w\$ '
I get exactly what I want. Everything is green and it's only applied for the root user so I can distinguish root from other users.
However, when I put this code (without "export") in /root/.bashrc
, I get this effect when I change the current shell to bash using the command bash
.
Example:
How can I make my shell green, without switching to "bash" everytime I connect, i.e. how can I apply this to the default shell aswell?
Debian 8.3 (Jessie) is used here
~/.bashrc
is read by Bash, what shell are you using? – kos – 2016-02-13T01:04:27.503echo $SHELL
returns/bin/bash
, so I'm obviously using bash. Why does this not work then? – bytecode77 – 2016-02-13T01:11:51.803Okay, I came closer now. When I create a file named
.profile
with the content. ~/.bashrc
, I get the green shell, but the text above the first input prompt is still gray. Is there a way to solve this? – bytecode77 – 2016-02-13T01:17:10.5031Yeah,
~/.bashrc
is read only by non-login shells,~/.profile
is read by login shells. Putting it in/etc/profile
instead should change the color of the MOTD as well. – kos – 2016-02-13T01:29:09.153Can you please put an answer with a description where exactly to put what and make everything (including MOTD) green, but only for root user? – bytecode77 – 2016-02-13T01:36:06.153
No, apparently it doesn't. I can't test this reliably right now; I'll boot my Debian VM later to check directly on Debian, but in the meantime you can try Googling for "change motd color". I'll try to post an answer later. – kos – 2016-02-13T01:46:43.563