
Explore grep and sed on Linux for beginners, covering regex concepts, pattern matching, email and phone validation, piping outputs, and scripting.
Apply grep with extended regex to extract valid e-mail addresses from a file, anchoring to line start, matching user and domain patterns, and saving results to a text file.
Learn to use grep and sed on linux to identify lines with correct phone numbers using regular expressions, print their line numbers, and script sed with expression files.
One of the most important tasks we undertake in Linux is processing text in files. This course explores two powerful tools we have to do this: grep and sed. Grep and sed find and manipulate text in files using regular expressions, which use special characters for searching and replacing text.
In the course, we’ll introduce regular expression syntax in the context of learning grep, then apply what we’ve learned as we work with sed. Topics include:
- finding text with grep
- regular expression syntax
- meta characters
- validating emails and phone numbers
- intro to sed
- replacing text in files
- line number addressing
- outputting only found lines
- printing line numbers
- adding text before and after lines
- simple sed scripts
The course is in two units, and runs just over an hour in length.