?
Solved

grep for something or something

Posted on 2008-11-06
3
Medium Priority
?
309 Views
Last Modified: 2013-12-16
Is there a way to grep for two words?

For example: grep invalid or failed in /var/log/auth.log

I can't seem to get anything to work.
0
Comment
Question by:bswinnerton
3 Comments
 
LVL 19

Assisted Solution

by:jools
jools earned 800 total points
ID: 22897640
egrep "invalid|failed" /var/log/auth.log
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 1200 total points
ID: 22897686
if you are not sure of case, then try

egrep -i "invalid|failed"  /var/log/auth.log
0
 
LVL 5

Author Closing Comment

by:bswinnerton
ID: 31514023
Perfect! Thank you
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question