From the course: Learning Linux Command Line

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Manipulate text with awk, sed, and sort

Manipulate text with awk, sed, and sort - Linux Tutorial

From the course: Learning Linux Command Line

Manipulate text with awk, sed, and sort

- [Instructor] One of the tasks of a system administrator, a systems analyst, a scientist, or a programmer, is to make use of information from various logs or outputs. We've seen how to look at files and how to search within them, so now let's take a look at reaching in and extracting particular data and presenting it in different ways. There's a few common tools for this, and which one we'd use is largely a matter of preference, so it's helpful to be at least a little familiar with both. These tools are called awk and sed. Both tools are widely used in command line operations, and you'll see them both as you explore system administration and systems programming. What awk is great at and is commonly used for in scripts is pulling data out of a file according to a rule. To define this rule, we write an awk program. We'll write that either at the command line or in a separate file if it's very complex, and that will tell awk how to get the data we want. Sed is also used for modifying…

Contents