Chapter 16. Configuring and Customizing bash

Would you want to work in an environment where you couldn’t adjust things to your liking? Imagine not being able to adjust the height of your chair, or being forced to walk the long way to the lunchroom, just because someone else thought that was the “right way.” That sort of inflexibility wouldn’t be acceptable for long; however, that’s what most users expect, and accept, from their computing environments. But if you’re used to thinking of your user interface as something inflexible and unchangeable, relax—the user interface is not carved in stone. bash lets you customize it so that it works with you, rather than against you.

bash gives you a very powerful and flexible environment. Part of that flexibility is the extent to which it can be customized. If you’re a casual Unix user, or if you’re used to a less flexible environment, you might not be aware of what’s possible. This chapter shows you how to configure bash to suit your individual needs and style. If you think the Unix cat command has a ridiculous name (most non-Unix people would agree), you can define an alias that renames it. If you use a few commands all the time, you can assign abbreviations to them, too—or even misspellings that correspond to your favorite typing errors (e.g., “mroe” for the more command). You can create your own commands, which can be used the same way as standard Unix commands. You can alter the prompt so that it contains useful information (like the ...

Get bash Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.