CHAPTER 24Text-Processing One-Liners

Even though this book is about using the shell's command language, I use a fair number of calls to other utilities for text processing. Sed, awk, and grep are the primary UNIX text-processing utilities, although I have used others. This chapter gives you a collection of short and useful one-liners that illustrate quite a few methods for gathering specific information from various textual sources.

Very often when writing a script, you need to know source data locations before you start pruning the data for further processing. For instance, you can find the load average of a running Linux system from the first line of the output of the top utility, the output of the uptime command, the output of the w command, ...

Get Expert Shell Scripting now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.