My question is pretty silly, but could not find nothing on the internet that explained me how. The thing is that I want to have the name displayed in the terminal as: Server mpi@raspberry: ... $
but can not find how to add the "name" Server to the user (I am calling that the name, but probably it is not correct). Instead, my terminal shows mpi@raspberry: ... $
2 Answers
Explaining further the answer of kodcode:
In order to add an alias, we have to enter to each user and write sudo gedit ~/.bashrc
, then we will see a lot of things written on this file, but the importante line to change is:
if [ "$color_prompt" = yes ]; then
PS1='\[\033[1;33m\]Alias ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
Replace Alias by the alias that you want and copy the code to the file replacing in the original file from the beginning of the if, until fi. This will help to know at which device we are connecting to.
You can use this online tool to create a customized prompt:
You want the "hostname" to be displayed.
-
1
-
4
-
1
-
PS1
variableecho $PS1
will show you what the current PS1 value is, then copy paste that toexport PS1="Server <<current value of PS1>>"
and check whether this is what you want ?