CertGrid CertGrid
Hands-on Lab·LPIC-1

Regular expressions and the text tools

Objective 103.7 examines regular expressions by name, and 103.2 the filters that use them. This guide answers real questions about one log file - who failed, who appears most, which lines are which - and finishes with xargs, which exists because some commands do not read standard input at all.

101: GNU and Unix Commands Guide 9 of 33 Beginner

One Debian-family host. Every command runs in a directory created and removed by the page, and nothing outside it is touched.
Server NameIP AddressOSRolesCPURAMHDD
LPIC1-A01192.168.0.76Ubuntu 26.04 LTSDebian-family host - dpkg and apt, which objective 102.4 names2 Core4 GB50 GB

This guide includes

Use this when a log, a CSV or any other text file has to answer a question - who appears most, which lines failed, what is in the third column. This matters because the answer is usually one pipeline away, and opening a 200,000-line log in an editor is how an afternoon disappears.

Before you start

  1. Anchors, alternation, and counting

  2. Fields, sorting and counting occurrences

  3. awk when a field decides, sed when text changes

  4. xargs, for commands that ignore stdin

Official sources