The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  




The egrep command, also known as grep -E, is a Linux command-line utility used for pattern matching and searching within text files. It is part of the grep family of commands that are designed to search for lines in text files that match a specified pattern or regular expression. The egrep command specifically enables extended regular expression support, allowing for more complex pattern matching than the basic grep command.

Here's a basic overview of how to use the egrep command:
egrep [OPTIONS] PATTERN [FILES] .


Some common options used with egrep include:

Example:
$ egrep "^hello" myfile.txt←To find all lines that start with the word "hello"



For more egrep examples, explanations, and options, refer to the provided link.