A
A
AndreyTT2015-09-11 14:05:24
bash
AndreyTT, 2015-09-11 14:05:24

How to properly colorize in SSH terminal on Ubuntu Server (.bashrc)?

I log into the Ubuntu 14.04 server via SSH Putty.
The terminal immediately gives the colors of the command line as follows:
230366f330b34c78a283ca08c6ba3c73.jpg
I immediately run the following command (the color of the time changes itself, I do nothing (!!)) - I enter forcibly from under the same user via SU - the terminal changes colors (as it should be):
37a98f3e72f34af6a1a923185a1b764a.jpg
Now Questions:
1. Why is the necessary directive PS1 in ./bashrc not immediately processed during login?
2. Initial prompt (with clock) where does ./bashrc come from?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2015-09-11
@AndreyTT

1. Because when logging in, ~/.bash_profile or ~/.profile is read. Usually they have lines like this: (in my ~/.profile)

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
  . "$HOME/.bashrc"
    fi
fi

If they are not there, then it is worth adding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question