Language Selection

English French German Italian Portuguese Spanish

8 Useful and Interesting Bash Prompts

Filed under

Many people don’t think of their command prompt as a particularly useful thing, or even pay it much attention. To me, this is a bit of a shame, as a useful prompt can change the way you use the command line. Well I’ve scoured the Interwebs looking for the best, most useful, or sometimes most amusing bash prompts. Here, in no particular order, are the ones I’d be most likely to use on my computers.

1. Show Happy face upon successful execution

This prompt is probably the most amusing one on the list, but remains useful. The idea is that as long as your commands execute successfully, your prompt shows a happy face. Any time a command fails, it shows a sad face instead.

PS1="\`if [ \$? = 0 ]; then echo \[\e[33m\]^_^\[\e[0m\]; else echo \[\e[31m\]O_O\[\e[0m\]; fi\`[\u@\h:\w]\\$ "

2.Change color on bad command
Here’s one of my favorites. This prompt has it all. Like above, the prompt changes color if your last command failed to run successfully, but it also shortens long paths and contains the bash history number of each command for easy retrieval.

rest here

More in Tux Machines

openSUSE Leap 42.1 + Cinnamon, XFCE, or Budgie = GeckoLinux

GeckoLinux is based on openSUSE Leap 42.1, and it exists to make the openSUSE distribution more refined and approachable. It has recently released live installable DVD editions featuring the Cinnamon, XFCE, and Budgie desktop environments. These include many refinements and features not available in the standard openSUSE Leap installation images.

Read more

GOL, Phoronix on Graphics

Supporting Software Freedom Conservancy

There are a number of important organizations in the Open Source and Free Software world that do tremendously valuable work. This includes groups such as the Linux Foundation, Free Software Foundation, Electronic Frontier Foundation, Apache Software Foundation, and others. Read more

Leftovers: OSS

  • Video: PBS Pro Workload Manager Goes Open Source
  • Turris Omnia: high-security, high-performance, open-source router
    An Indigogo campaign was recently launched for the Turis Omnia, promising backers a high-security, high-performance, open-source router. “With powerful hardware, Turris Omnia can handle gigabit traffic and still be able to do much more,” the company said. “You can use it as a home server, NAS, printserver, and it even has a virtual server built-in.”
  • IBM SystemML Machine Learning Technology Goes Open-Source
  • PuppetLabs Introduces Application Orchestration
    Everybody loves Puppet! Or at the very least, an awful lot of people USE Puppet and in the IT world, “love” is often best expressed by the opening of one’s wallet. I know, in the FOSS world wallets are unnecessary, and Puppet does indeed have an Open Source version. However, once one gets to enterprise-level computing, a tool designed for enterprise scale is preferable and usually there is a cost associated. Puppet was originally started as an open source project by Luke Kanies in 2005, essentially out of frustration with the other configuration management products available at the time. Their first commercial product was released in 2011, and today it is the most widely used configuration management tool in the world with about 30,000 companies running it. According to our own surveys, better than 60% of Linux Journal readers use some form of Puppet already and you must like it too as it regularly finishes at or near the top in Readers’ Choice awards.