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 Answer 1

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).

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .