I asked this question some time ago about the shell does not displaying the path. Recently I found out that the .bashrc does not get sourced (and this should be a normal practice?). Currently, the shell command prompt is like this:
-bash-4.3#
after I executed source .bashrc, I am able to obtain my expected shell command prompt:
root@ubuntu2011:~#
where ubuntu2011 is the machine name. How can I make the prompt looks like the latter one every time I login?
p.s. the .bashrc is from: cp /etc/skel/.bashrc ~/.bashrc
UPDATE: the contents of ~/.profile is as follow:
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n
and echo $BASH returns /bin/bash
UPDATE: Answers of @terdon's questions:
- How do I login to server?
I use
ssh [email protected]to login asroot
- Are those command executed as root?
Yes.
UPDATE: The output of ls -l ~/.{profile,bashrc,bash_profile,bash_login}:
ls: cannot access /root/.bash_login: No such file or directory
-rw-r--r-- 1 root root 63 Dec 24 2012 /root/.bash_profile
-rw-r--r-- 1 root root 3637 May 17 17:00 /root/.bashrc
-rw-r--r-- 1 root root 140 Apr 23 2010 /root/.profile