Graphical environments have lots of fun add-ons, such as skins, themes, and more. If you use a terminal or other shell-based applications, it’s enough to make you feel left out. This month’s “Power Tools” column aims to change that.
Graphical environments have lots of fun add-ons, such as skins, themes, and more. If you use a terminal or other shell-based applications, it’s enough to make you feel left out. This month’s “Power Tools” column aims to change that.
You might call this column “Stupid Shell tricks,” but that’s not quite right because we’ll see useful techniques!
For example, displaying a shell prompt in multiple colors may not do much for your resume, but knowing how to make important text appear in bright red can help you spot serious conditions. We’ll also look at shell quoting and interpretation, escape sequences, and the usual grab-bag of curiosities and oddities that are hard to find, but good to know. Let’s dig in — for fun and profit.
Prompt Preview
When a shell is ready for your next command, it prints a prompt and waits. Left-side prompts usually end with $ on Bourne-type shells like bash and ksh, with % on csh and zsh, and > on tcsh. Shells running as the superuser, root, prompt with # to remind you of your wizardly powers.
Most shells have several left-side prompts — for unfinished command lines, for debugging output, and more. The zsh and tcsh shells can also prompt on the right side. These right-side prompts are handy for periodic notices, like the “high load” warning that you’ll see later in a left-side prompt. This column won’t cover any of these right-side prompts except to say that,…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: