Colorful » Linux Magazine


You don’t necessarily need color on the terminal, but still, it does look good – and does not involve too much effort.

If you look at the output of the common Linux commands, there is always one impressive feature: simplicity. Nothing flashes, wobbles, or makes a noise – plain-vanilla information without any distracting trappings. In today’s world, where every device or open tab in the web browser begs for attention with a beep, this approach, which may seem anachronistic to newcomers, supports a focused work approach and lets you fully concentrate on solving the problem at hand. Simply fantastic.

Why Color?

If everything is so perfect, why bother with color? Color helps to highlight things and draw your attention to a particular point or fact. Let’s take a look at how we can spice up the output on the command line with some color. Note that how the output is actually displayed depends on the terminal, its size, the fonts used, and other settings. After all, you still want output to remain legible.

Without color, neither the developer nor the program have to worry about the properties of the terminal currently in use. Nobody needs to know how the user’s terminal is set up and what output the program uses (e.g., whether it is a simple display on the terminal, a redirect to a file, or further processing via a pipe). Remember: Color increases complexity.


Use Express-Checkout link below to read the full article (PDF).

Source link