0

I am trying to customize the bash prompt on Linux Debian 9.

I got the script from Github and I modified the file .bashrc

On the terminal, when I log in as root, I can see the customization I was looking for, but once I exit to the normal user, all the customization vanishes and I go back to the old looking of Debian's terminal.

On the /root folder I have 2 relevant files .bashrc and .profile

The .profile file is configured to import the configuration from the .bashrc file by default, so I did not change anything in there.

The /root/.profile file configuraton:

# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

mesg n || true

So the question is: how can I make my user bash customization the same as my root (su) bash customization?

Screenshots included:

When I first launch my terminal:

enter image description here

When I log in as root:

enter image description here

When I exit root:

enter image description here

1

Each user has their own .bashrc and .profile configuration file on Debian.

So, you could enter your customized prompt also in /home/sparrow/.bashrc.

Alternatively, you can move your changes from /root/.bashrc to /etc/bash.bashrc, which would then work for both users root and sparrow (in fact for all users on your system).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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