Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've seen on a few screencasts a while back where someone had a lightning bolt instead of $ on the bash prompt.

Does anyone know how to do this?

share|improve this question

migrated from stackoverflow.com Dec 5 '10 at 14:12

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

up vote 6 down vote accepted

This page explains how to set your bash promt. As @ulidtko says, you can use as one example of a lightning bolt symbol. To set this, use:

export PS1=⚡

You will, however, lose everything else in the prompt you had before (not just the $). What you had before depends on your distribution. On my Ubuntu 10.10 setup it's \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ by default, which you can get by running echo $PS1. To use mine as an example, to just change the $ to a , run:

export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w⚡ "

To make this change across all bash shells, add the above line to your ~/.bashrc file.

The result is like this:

marcog@minime:~⚡ echo hello world
hello world
share|improve this answer
add comment

There are a few lightning-bolt-like symbols in Unicode, among them is U+2607 LIGHTNING (), though anything approaching realistic would require a special font with an actual lightning bolt glyph.

share|improve this answer
add comment

Ignacio's answer is right, but here is another symbol, which in my font looks better: U+26A1 HIGH VOLTAGE SIGN ()

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.