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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
The importance of modularity2m 37s
-
(Locked)
Use pipes to connect commands together2m 54s
-
(Locked)
View text files with cat, head, tail, and less4m 46s
-
(Locked)
Search for text in files and streams with grep5m 21s
-
(Locked)
Manipulate text with awk, sed, and sort7m 33s
-
(Locked)
Edit text with Vim5m 14s
-
(Locked)
Edit text with nano2m 38s
-
(Locked)
Working with tar and zip archives9m 26s
-
(Locked)
Challenge: Create and share a file24s
-
(Locked)
Solution: Create and share a file1m 41s
-
(Locked)
Output redirection5m 38s
-
(Locked)
Exploring environment variables and PATH4m 20s
-
(Locked)
Challenge: Extract information from a text file1m 2s
-
(Locked)
Solution: Extract information from a text file4m
-
(Locked)
-
-