Learn Linux Shell Scripting - Fundamentals of Shell 4.4 by Sebastiaan Tammer
Author:Sebastiaan Tammer [Sebastiaan Tammer]
Language: eng
Format: epub
Tags: COM088010 - COMPUTERS / System Administration / Linux and UNIX Administration, COM046070 - COMPUTERS / Operating Systems / Linux, COM088000 - COMPUTERS / System Administration / General
Publisher: Packt
Published: 2018-12-31T05:13:15+00:00
Summary
This chapter explained regular expressions, and two common tools that use them under Linux: grep and sed.
We began by explaining that regular expressions are search patterns, used in combination with text to find matches. These search patterns allow us to search very flexibly in text where its contents are not necessarily known at runtime.
Search patterns allow us, for example, to look only for words and not numbers, for words at the beginnings or endings of lines, or for empty lines. Search patterns include wildcards, which can represent one or more of a certain character or character class.
We introduced the grep command to show how we can use the basic functionality of regular expressions in Bash.
The second part of this chapter dealt with globbing. Globbing is used as a wildcard mechanism for file names and paths. It has similarities with regular expressions, but also some key differences. Globbing can be used with most commands that deal with files (and, since most things under Linux can be considered files, this means almost all commands support some form of globbing).
The last half of the chapter described using regular expressions with egrep and sed. egrep, being a simple wrapper for grep -E, allows us to use extended syntax for regular expressions, which we discussed along with some often-used, advanced features of grep.
In contrast to default regular expressions, extended regular expressions allow us to specify the length of certain patterns and how often they repeat, as well as allowing us to use alternation.
The final part of this chapter described sed, the stream editor. sed is a complex but very powerful command, which allows us to do even more exciting stuff than grep.
The following commands were introduced in this chapter: grep, set, egrep, and sed.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Disaster & Recovery | Email Administration |
Linux & UNIX Administration | Storage & Retrieval |
Windows Administration |
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7778)
Grails in Action by Glen Smith Peter Ledbrook(7696)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6534)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6521)
Running Windows Containers on AWS by Marcio Morales(6047)
Kotlin in Action by Dmitry Jemerov(5062)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(4895)
Combating Crime on the Dark Web by Nearchos Nearchou(4478)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4414)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4305)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4153)
The Age of Surveillance Capitalism by Shoshana Zuboff(3946)
Python for Security and Networking - Third Edition by José Manuel Ortega(3714)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3503)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3389)
Mastering Python for Networking and Security by José Manuel Ortega(3344)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3327)
Blockchain Basics by Daniel Drescher(3292)
Learn Wireshark by Lisa Bock(3227)
