Browsing articles tagged with " Linux"

Color your shell

May 4, 2012   //   by Teo   //   Amarok, KDE  //  19 Comments

The UNIX terminal UI has stood the test of time. Tools change, new tools crop up, certain tools are used commonly and others less so. I don’t see the familiar UNIX terminal concept becoming obsolete any time soon. The extensibility and sheer power that comes with it is the best thing since sliced bread.

Now, I like colors and pretty pictures. More specifically, I find it much easier to recognize a piece of information if it is colored in a meaningful way, this is the whole reasoning behind syntax highlighting in IDEs. Luckily some other people like colors and pretty pictures too, and with the power of Free Software they have come up with various ways to add some color to common UNIX-compatible shell tools.

Some of these are just wrapper scripts for existing tools, and some are entire rewrites with lots of added functionality. Some distributions already provide a somewhat colored environment. Some of them contribute to making my shell a much more colorful place.

cw

cw is a color wrapper for common UNIX commands. According to the project’s website, “it is designed to simulate the environment of the commands being executed, so that if a person types ‘du’, ‘df’, ‘ping’, etc. in their shell it will automatically color the output in real-time according to a definition file containing the color format desired.”

cw wrapper scripts do not modify the functionality of the tools involved, they just add colors, so they are a good choice even if you alias some of them to other, more sophisticated tools. Some of the added colors are just eye candy, and some of them are actually very useful.

htop

htop is an interactive process viewer for Linux. It is not just a wrapper for top, this is a completely rewritten and much more featureful program. I alias it in my .bashrc in place of top.

dfc

I have tried at least three colored replacements and/or wrappers for df, and dfc is the one I like best. I keep it aliased in place of df.

Other note worthy alternatives include pydf (also very nice) and cdf.

cdu

cdu stands for “color du” and it is a Perl wrapper for du. I keep it aliased in place of du.

ls++

ls++ is a tool I’m currently still testing. It is a wrapper for plain old ls, it uses common color schemes for file types (as used by the –color parameter of GNU ls) and mangles the output a bit to make it more relevant. I like how it shows permissions and dates.

Other programs

For many prominent toolchain elements there is a colorized variant or wrapper, such as colordiff, colorgcc, colorsvn, colormake and others. Some of them actually already produce very good colored output with the right options (without wrappers), like grep or tree, and are easily aliased in .bashrc to always show colored output.

Combine all that with a nice LS_COLORS in .bashrc courtesy of dircolors and a nice colored prompt and your shell will make you puke rainbows in no time ;)

Lastly, as a bit of bonus content for Archlinux users I’d like to mention pacman-color and yaourt, they make pacman so awesome it’s not even funny.

Blog Categories

1

Google+ Activity

  • HAHAHA! OH WOW! -- 1 month ago
  • So glad I never used #MtGox for my coin exchange needs. My sympathies to the people who lost money to these scumbags, I hope they get caught. -- 1 month ago
  • Bro pages! For when you just want to get things done instead of going through never ending walls of text in man pages. -- 2 months ago

Enter your email address to subscribe to this blog and receive notifications of new posts by email.