Grep: Difference between revisions

From Hackepedia
Jump to navigationJump to search
m added brackets
No edit summary
Line 2: Line 2:


  $ egrep '(fish|fowl)' file
  $ egrep '(fish|fowl)' file
To show all lines that do not start with a # (commented out):
# grep -v ^# /etc/inetd.conf

Revision as of 16:35, 8 April 2006

If you want to grep for two strings? say fish OR fowl in your file:

$ egrep '(fish|fowl)' file

To show all lines that do not start with a # (commented out):

# grep -v ^# /etc/inetd.conf