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

Search text using regular expressions - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

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…

Contents