I would like to add _ENV to my bash so once I ssh to the server it shows something like this:

[live][root@server ~]#


[dev][root@server ~]#

How can I do this? I have been looking everywhere for this but without any luck.

Thank you!


Stick something like this at the end of your ~/.bashrc

export PS1='[live][\u@\h \w]# '

The dev/live is hard-coded in so you'll need to edit that unless you've got a method of picking that out.

You can also add a splash of colour to make it easier to notice.

export PS1='[\[\033[0;35m\]live\[\033[00m\]][\u@\h \w]# '

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.