From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Search text using regular expressions - Linux Tutorial
From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)
Search text using regular expressions
- [Instructor] We've already talked about how to find text in a file using grep. Let's talk more about using grep in extended regular expressions. Grep may be the most common tool in Linux to use regular expressions with. In fact, the name grep stands for global regular expression print. By default, grep uses basic regular expressions, or BREs, but it supports EREs if you pass the dash E option, or you use the the E-grep command. The E-grep command name has been deprecated, but it's kept around for historical reasons, as some tools still rely on that name existing. We're going to focus on using EREs with grep in this video. If you want to force grep to process a regular expression as a BRE, you can pass the dash G option. Perhaps the only way of using perl compatible regular expressions in Bash is to pass the dah capital P option to grep. This is experimental and not all features are supported. Normally, the expression…
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
-
-
-
-
-
-
-
-
-
-
-
Understand the differences between basic and extended regular expressions3m 38s
-
Matching characters and words with regexes3m 5s
-
Specifying occurrences with regexes1m 56s
-
Alternation and grouping with regexes3m 21s
-
Back references and subexpressions1m 48s
-
Search text using regular expressions5m 31s
-
Use regular expressions to delete, change, and substitute text5m 16s
-
Awareness of Emacs, Nano, and Vim2m 49s
-
An introduction to Vim3m 33s
-
Edit text in Vim2m 45s
-
Search and replace in Vim2m 26s
-
-
-
-
-