Language Selection

English French German Italian Portuguese Spanish

8 Useful and Interesting Bash Prompts

Filed under
Software

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

Leftovers: Gaming

Fedora: The Latest

Leftovers: KDE

  • ocs-client GSoC
    So my GSoC is coming to its end. I have no cool screenshots to upload this time and I have no new great features to talk about, in fact Caludio and I manly focused on bugfixing and testing. We have spent time also discussing about possible changes and improvements to the current OCS protocol. So is the client ready do be lunched? In short I would say that no, not yet.. although most of its features are implemented and it is usable, it is still an “under construction” project, we both still have to make some important decisions to make it usable to everyone.
  • The Fiber Engine Poll, Updates, and Breeze
  • Bringing Akonadi Next up to speed
    and refactoring it again, to make sure the codebase remains as clean as possible. The result of that is that an implementation of a simple resource only takes a couple of template instantiations, apart from code that interacts with the datasource (e.g. your IMAP Server) which I obviously can’t do for the resource.
  • New linter integration plugins for KDevelop
  • Artikulate Plans for Randa
    Language learning is often considered as the task of memorizing new vocabulary and understanding the new grammar rules. Yet for most, the most challenging part is to actually get used to speak the new language. This is a problem that Artikulate approaches with a simple idea: to learn the correct pronunciation of a word or even a longer phrase, the learner listens to a native speaker recording, repeats and recordings it, and finally compares both recordings to improve herself/himself with the next try.

Tails 1.5.1 is out

Tails, The Amnesic Incognito Live System, version 1.5.1, is out. This is an emergency release, triggered by an unscheduled Firefox release meant to fix critical security issues. Read more