Skip to Content
Learning Linux Shell Scripting
book

Learning Linux Shell Scripting

by Ganesh Sanjiv Naik
December 2015
Beginner
306 pages
5h 2m
English
Packt Publishing
Content preview from Learning Linux Shell Scripting

Chapter 12. Pattern Matching and Regular Expressions with sed and awk

In the previous chapter, you learned about Linux system's startup, from power-on till user login, and how to customize a Linux system environment.

In this chapter, we will cover the following topics:

  • Understanding regular expressions
  • Stream editor (sed) for text processing
  • Using awk for text processing

The basics of regular expressions

A sequence of characters that have certain patterns of text (with meta-characters), which will be searched from in a larger text or file is called regular expressions:

$ ll /proc | grep cpuinfo

In the preceding command, the grep utility will search for the cpuinfo text in all lines of input text and will print lines that have the cpuinfo text.

The utilities ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Linux Shell Scripting - Second Edition

Learning Linux Shell Scripting - Second Edition

Ganesh Sanjiv Naik

Publisher Resources

ISBN: 9781785286216