Also, I'd like to offer some words of caution to those who want lots of "external" (i.e. not bash-native) data in their PS1 string. Running outside programs can be expensive. For personal workstation use, things like the above are great. However, if you administer a remote (perhaps resource-constrained) server and you find yourself trying to rescue it from swap-death (or a partially busted HDD), you may not want to be 1) forking subprocesses, 2) allocating file descriptors, and 3) doing disk IO every time you hit the enter key. Build responsible prompt strings everyone.