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 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.