Changing your command prompt in linux

I created this example using Ubuntu 18.04

Credit to https://www.reddit.com/user/t0thkr1s for this specific style

By editing the .bashrc file we can change the command prompt from

$feoleb@titan:~$

to

┌─[feoleb@titan]─[~]
└──╼ $
  1. Edit the .bashrc file in your root directory
  2. Change the xterm PS1 value from default to the following, and then open a new terminal window (or ssh connection if it’s remote)
    • xterm*|rxvt*)
         PS1="\[3[0;31m\]244240$([[ $? != 0 ]] && echo \"[\[3[0;31m\]247\[3[0;37m\]]240\")[$(if [[ ${EUID} == 0 ]]; then echo '\[3[01;31m\]root\[3[01;33m\]@\[3[01;96m\]\h'; else echo '\[3[0;39m\]\u\[3[01;33m\]@\[3[01;96m\]\h'; fi)\[3[0;31m\]]240[\[3[0;32m\]\w\[3[0;31m\]]\n\[3[0;31m\]244240240254 \[3[0m\]\[\e[01;33m\]\$\[\e[0m\]"