Ubuntu – Customize the command shell default prompt

bash

Need help to change the command prompt. I want short name. Look below :

kirti@kirti-Aspire-5733Z:~$ cd workspace
kirti@kirti-Aspire-5733Z:~/workspace$ cd Ruby
kirti@kirti-Aspire-5733Z:~/workspace/Ruby$

I am looking for my initial command prompt, when I will open it using 'Ctrl+Alt+t' as

 $(arup):
 $(arup): cd workspace
 $(workspace): cd Ruby
 $(Ruby) :

In my ~/.bashrc file did put as below :

if [ "$color_prompt" = yes ]; then
PROMPT_DIRTRIM=1
PS1='\w\ $ '
else
PS1='\w\ $ '

By replacing

if [ "$color_prompt" = yes ]; then
    PS1='${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\$ '
    PS1='arup :\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

But I didn't find any change in my shell:

enter image description here
May I have some help to configure the above settings ?

Best Answer

I took help from How to: Change / Setup bash custom prompt (PS1)

I did first sudo gedit /etc/bashrc. Then did below change :

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='(arup~>\W)$'

Now my prompt is coming close to my expectation -

enter image description here