From the course: Complete Guide to Navigating Linux: Working with Users, Files, and Networks
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
A primer to regular expressions - Linux Tutorial
From the course: Complete Guide to Navigating Linux: Working with Users, Files, and Networks
A primer to regular expressions
- In this video, we'll do an introduction to a regular expressions. A regular expression is a flexible search pattern. And you use it in text processing utilities like grep. Regular expressions are powerful, but also a bit confusing, because different sets of regular expressions exist. But I recommend that you know a bit about the basics. So, let's talk about some essential regular expressions. The anchor, caret, refers to beginning of the line. So if you would use grep '^l' on myfile, you print lines that start with an l. Notice how the regular expression is written? It should be between single quotes. And that is to avoid interpretation problems. That's because in a regular expressions, you will have characters that also have special meaning in the shell! Like the dollar! Which in a regular expression is referring to the end of the file. Or the dot, which in the regex, refers to a single character! Here, you can see grep '^.$' which means that we are looking for files that have one…
Contents
-
-
-
-
-
(Locked)
Learning objectives43s
-
(Locked)
Creating text files5m 55s
-
(Locked)
Using common text file processing tools8m 18s
-
(Locked)
A primer to regular expressions4m 59s
-
(Locked)
Reading system logs3m 11s
-
Understanding mounts2m 55s
-
(Locked)
Mounting a USB thumb drive4m 2s
-
(Locked)
Command overview1m 22s
-
(Locked)
Lesson 3 lab: Managing text files, logs, and editors31s
-
(Locked)
Lesson 3 lab solution: Managing text files, logs, and editors1m 47s
-
(Locked)
-
-