The Ultimate Command Prompt

create a file named ps.sh in /etc/profile.d directory. Add the following line in the file

 

PS1="\[$(tput setaf 1)\]\u@\[$(tput setaf 2)\]\h\[$(tput setaf 1)\]: \W \\$ \[$(tput sgr0)\]"

 

Explained :

$(tput setaf 1) set the color to red

\u is current user

\h is the host name

\W is the working directory

$(tput sgr0) reset the color to default again

 

 

 

Leave a Comment

Your email address will not be published.