Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

What is the grep command ???

by anakin30 (Acolyte)
on Aug 18, 2010 at 08:49 UTC ( #855710=perlquestion: print w/ replies, xml ) Need Help??
anakin30 has asked for the wisdom of the Perl Monks concerning the following question:

i have log file below. I need to grep all the lines which has word "MOD", "DEL" only from the file. can someone help me, with the grep command. i tried with the command below and i can only grep lines with the word "MOD" not DEL as well.. Can someone help me. tail -f <filename> | egrep '(MOD|DEL)' sample log file:- conn=105611 op=38083 msgId=38084 - EXT oid="1.3.6.1.4.1.42.2.27.9.6.8" conn=105611 op=0 msgId=38084 - MOD dn="uid=cpb4tpz1,ou=users,o=dhl.com" conn=105611 op=0 msgId=38084 - RESULT err=0 tag=103 nentries=0 etime=0 csn=4c6c19c100020c1d0000 conn=105611 op=38083 msgId=38084 - RESULT err=0 tag=120 nentries=0 etime=0 conn=105611 op=38084 msgId=38085 - EXT oid="1.3.6.1.4.1.42.2.27.9.6.5" conn=108681 op=0 msgId=95 - MOD dn="cn=asia,cn=mydigi.maxis.com.my, conn=108681 op=0 msgId=95 - RESULT err=0 tag=103 nentries=0 etime=0 csn=4c6b9b0a00170c1e0000 conn=108681 op=94 msgId=95 - RESULT err=0 tag=120 nentries=0 etime=0 conn=108681 op=95 msgId=96 - EXT oid="1.3.6.1.4.1.42.2.27.9.6.5" conn=105611 op=0 msgId=38084 - ADD dn="uid=user1,ou=users,o=dhl.com" conn=108681 op=0 msgId=95 - RESULT err=0 tag=103 nentries=0 etime=0 csn=4c6b9b0a00170c1e0000 conn=108681 op=94 msgId=95 - RESULT err=0 tag=120 nentries=0 etime=0 conn=108681 op=95 msgId=96 - EXT oid="1.3.6.1.4.1.42.2.27.9.6.5" conn=105611 op=0 msgId=38084 - MOD dn="uid=user1,ou=users,o=dhl.com"

Comment on What is the grep command ???
Re: What is the grep command ???
by marto (Chancellor) on Aug 18, 2010 at 08:55 UTC

      I'm so sorry for that. I will go through the steps to post the question effectively and the Markup in the Monastery.

      I thought you guys don't mind to help with the unix code as well, guess i'm wrong. I will correct it anyhow. thanks for your advice.

        The issue is not necessarily the unix coding question (although, an "OT: " at the beginning of your title would have been a courtesy), but repeatedly ignoring requests on previous posts for proper formatting, attempting some self education, showing your attempts at a solution, etc.

        As was stated above, this is not a free code-writing service, but it is a community of people with an interest in Perl, learning, and contribution. Coming into a community, and expecting to be well received after abusing norms and charity is presumptuous at best.

        Learn through trial and error, ask questions about your learning, and attempt to grow from advice given (code tags, for example).

        Welcome to PerlMonks. This is a nice place, but you only get out of it what you put into it.

        --MidLifeXis

Re: What is the grep command ???
by moritz (Cardinal) on Aug 18, 2010 at 08:56 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://855710]
Approved by rovf
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2014-09-21 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (175 votes), past polls