Полезная информация

Learning the Unix Operating System

Learning the Unix Operating SystemSearch this book
Previous: 7.1 Standard UNIX DocumentationChapter 7
Where to Go from Here
Next: 7.3 Programming

7.2 Shell Aliases and Functions

If you type command names that are hard for you to remember, or command lines that seem too long, you'll want to learn about shell aliases and functions. These shell features let you abbreviate commands, command lines, and long series of commands. In most cases, you can replace them with a single word or a word and a few arguments. For example, one of the long pipelines in Chapter 5, Redirecting I/O , could be replaced by an alias or function named (for instance) "aug". When you type aug at a shell prompt, the shell would list files modified in August, sorted by size.

Making an alias or function is almost as simple as typing in the command line or lines that you want to run. The references in Appendix A, Reading List , have more information. Shell aliases and functions are actually a simple case of shell programming.

Previous: 7.1 Standard UNIX DocumentationLearning the Unix Operating SystemNext: 7.3 Programming
7.1 Standard UNIX DocumentationBook Index7.3 Programming

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System