Smiley Face Bash Prompt

PS1="\`if [ \$? = 0 ]; then echo \e[33\;40m\\\^\\\_\\\^\e[0m; else echo \e[36\;40m\\\-\e[0m\\\_\e[36\;40m\\\-\e[0m; fi\` \u \w:\h)"
If your last command was a dud, your bash prompt will be angry at you. Otherwise it's happy. Soon you will crave its constant approval and your linux skills will improve simply to avoid low self-esteem.
Sample Output
^_^ # true
^_^ # false
-_- #

18
2009-06-30 14:29:55

What Others Think

haha! love it!
nottings · 615 weeks and 5 days ago
Very good. Is not for men?
point_to_null · 615 weeks and 5 days ago
a bit emo, but very amusing!
irae · 615 weeks and 4 days ago
it is a very fun command. However, the open colors screw with the ability of (at least gnome-terminal) wrapping text to the next line. Be sure to open and close around each color set to fix this. example: \[\e[36\;40m\]. and when setting back to defaults, leave the semicolon outside. example: \[\e[0m\];
random_bob · 615 weeks and 3 days ago
Thanks. Now, my prompt has officially been rendered unreadable ;-) PS1="\[\033[0;33m\]\u@\h\[\033[0m\]:\[\033[0;36m\]\A\[\033[0m\]:\`if [ \$? = 0 ]; then echo \e[33\;40m\\\^\\\_\\\^\e[0m; else echo \e[36\;40m\\\-\e[0m\\\_\e[36\;40m\\\-\e[0m; fi\`:\[\033[1;34m\]\w\[\033[0m\]>\[\033[0m\] "
Alanceil · 615 weeks and 3 days ago
"Edit": Cleaned up edition with less escapes and a transparent background for the smiley (instead of black): PS1="\033[0;32m\u@\h\033[0m:\033[0;36m\A\033[0m:\`if [ \$? = 0 ]; then echo '\033[1;30m^_^\033[0m'; else echo '\033[0;33m>_>\033[0m' ; fi\`:\033[1;34m\w\033[0m>\033[0m "
Alanceil · 615 weeks and 3 days ago
I went along the same lines, but closed the color codes; PS1="\`if [ \$? = 0 ]; then echo \[\e[34m\]^_^\[\e[0m\]; else echo \[\e[31m\]O_O\[\e[0m\]; fi\`[\u@\h:\w]\\$ " this way it handles text wrap for long commands (like this one)
random_bob · 614 weeks and 6 days ago
Here are some more advanced prompts: http://www.askapache.com/linux/bash-power-prompt.html
AskApache · 238 weeks ago
Can't get it. Just want to know the Best NFL players to pick for fantasy football
paultribbiani · 34 weeks and 2 days ago
I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. Click here
bojokey283 · 16 weeks and 1 day ago
Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. instagram Abonnenten kaufen bei abonnenten24.de
bojokey283 · 15 weeks and 1 day ago
I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. Domótica
bojokey283 · 15 weeks ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. digital marketing
bojokey283 · 14 weeks and 6 days ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. alquiler de carros en cartagena
bojokey283 · 13 weeks and 1 day ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. bridgend house clearance
bojokey283 · 13 weeks ago
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. hartlepool removals
bojokey283 · 13 weeks ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. Heimautomation
bojokey283 · 12 weeks and 4 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. tree surgeon in colchester
bojokey283 · 12 weeks and 4 days ago
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. covid isla mujeres
bojokey283 · 12 weeks and 1 day ago
Awesome article! I want people to know just how good this information is in your article. It’s interesting, compelling content. Your views are much like my own concerning this subject. best places to snorkel in cozumel
bojokey283 · 11 weeks ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. legjobb" rel="nofollow">http://www.fokuszpalyazat.hu/'>legjobb pályázatírás Debrecen
bojokey283 · 8 weeks and 3 days ago
Very amusing. Should be fun to implement. pressure cleaners sunshine coast
FLM76 · 7 weeks and 4 days ago
I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. rumah pintar
bojokey283 · 7 weeks and 4 days ago
I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. kombájn szállítás vágóasztallal
bojokey283 · 6 weeks and 5 days ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. 5 star resort cozumel
bojokey283 · 6 weeks and 5 days ago
I know your expertise on this. I must say we should have an online discussion on this. Writing only comments will close the discussion straight away! And will restrict the benefits from this information. best place to eat in cozumel
xoheko1229 · 6 weeks and 5 days ago
I am hoping the same best effort from you in the future as well. In fact your creative writing skills has inspired me. best place to eat in cozumel
xoheko1229 · 6 weeks and 4 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. all inclusive cozumel trips
bojokey283 · 6 weeks and 4 days ago
Brilliant! I like to know more about command and other techniques. -SAM | https://massagewestport.com
vassist960 · 6 weeks and 2 days ago
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. where is cozumel island
xoheko1229 · 6 weeks ago
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. yuctana food
xoheko1229 · 6 weeks ago
This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!. tulum resorts all inclusive adults only
xoheko1229 · 6 weeks ago
Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here. tulum top restaurants
xoheko1229 · 5 weeks and 6 days ago
Please let me know if you’re looking for a article writer for your site. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some material for your blog in exchange for a link back to mine. Please send me an email if interested. Thank you! top hotels in playa del carmen
xoheko1229 · 5 weeks and 4 days ago
Please let me know if you’re looking for a article writer for your site. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some material for your blog in exchange for a link back to mine. Please send me an email if interested. Thank you! top restaurants holbox
xoheko1229 · 5 weeks and 1 day ago
Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. treatnheal
xoheko1229 · 3 weeks and 2 days ago
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Automatyka hoteli
xoheko1229 · 3 weeks ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. luxury bathroom vanity
bojokey283 · 2 weeks ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. coronavirus mexico
bojokey283 · 6 days ago
I have not any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. covid yucatan
bojokey283 · 5 days ago
Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! What to do in Hualien
bojokey283 · 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: