Unix: Useful and pretty prompt

Published:

Some servers at work has varying degrees of useful prompts when I connect to them through SSH. Usually they are quite annoying and for example showing the shell type and version, which I frankly don't care much about. Here's how to make it show the current user, hostname and working directory. In addition the hostname is made more visible, which is a nice effect.

$ bold=$(tput bold)
$ reset=$(tput sgr0)
$ export PS1="\u@\[$bold\]\h\[$reset\]:\w\$ "

Stick it in your .profile, .bash_profile or whatever else you've got going on to make it more permanent.