Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Good Afternoon,

(OS X user)

I am specifically trying to pipe the output of every shell command I type into the ruby gem 'lolcat' (which makes the output to the terminal rainbow colored).

Is there a way to do this without explicitly aliasing command individually? I was thinking perhaps there might be a way to pipe anything before the return key is pressed , but I am not sure how to do this.

Your assistance is appreciated, as I am tired of looking at just one color in my terminal.

share|improve this question
up vote 2 down vote accepted

You can redirect stdout in your shell:

exec 1> >(lolcat)


if lolcat sends its own output to stdout, you're bound to run into problems. This might work

exec 1> >(lolcat >&2)
share|improve this answer
Thanks Glenn! How would I incorporate this into my .bashrc, alias the exec command? – user1442303 Aug 8 '13 at 15:13
I'm not sure that's working, so I'd explicitly turn it on (don't make it the default behaviour): lol() { exec 1> >(lolcat); } and to turn it off: unlol() { exec 1> /dev/stdout; } – glenn jackman Aug 8 '13 at 15:21
I'm sure there will be some issues (I've noticed when turned on programs like 'nano' will not work), but this is exactly what I was looking for. Thank you. – user1442303 Aug 8 '13 at 15:35
I feel like you want to shoot yourself in the foot and I just gave you the gun. Good luck. – glenn jackman Aug 8 '13 at 15:42
At the risk of accidentally doing something I'll regret (which now seems to be much higher than usual), I'm leaving it off and just aliasing ls for now. – user1442303 Aug 8 '13 at 15:49

Your Answer


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.