Fancy and useful bash prompt

Is your old bash prompt a bit “outdated”? Ok, let’s give it some spice.

Open your


/etc/profile

and throw the following line in (no linebreak):


export PS1="\[\033[1;32m\][\$(date +%H:%M)]\[\033[0;36m\][\u@\[\033[0;31m\]\h:\[\033[1;34m\]\w]\[\033[0m\]"

Save, close the file and issue the following command:


source /etc/profile

What do you get? Well…something like this:


[18:05][root@moveaway:/home]

It’s:


[HH:MM][user@hostname:/current_dir]

Have a nice and colorful day!

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny