Find the answer to your Linux question:
Results 1 to 2 of 2
Hi all, I am charan and I am new to the world of Linux. I am currently searching a log files server.log, server1.log, server2.log which has the following format NAME ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    1

    Help regarding piping


    Hi all,

    I am charan and I am new to the world of Linux. I am currently searching a log files server.log, server1.log, server2.log which has the following format NAME (title), DATE (dd/mm/yy), ERROR (error number), etc. I need to search for the lines with ERROR: 128, NAME: mobile, DATE: 15/10/10. I know that its present in one the files but not sure which one.

    I am using grep and nothing shows at all.

    grep 15/10/10 *.log | grep mobile | grep 128

    Please help with this issue and I thank you all in advance for your help.

    Thanks
    Charan
    Last edited by charanv; 10-19-2010 at 02:57 AM. Reason: spell

  2. #2
    Just Joined! barriehie's Avatar
    Join Date
    Apr 2008
    Location
    The Desert!
    Posts
    85
    Quote Originally Posted by charanv View Post
    Hi all,

    I am charan and I am new to the world of Linux. I am currently searching a log files server.log, server1.log, server2.log which has the following format NAME (title), DATE (dd/mm/yy), ERROR (error number), etc. I need to search for the lines with ERROR: 128, NAME: mobile, DATE: 15/10/10. I know that its present in one the files but not sure which one.

    I am using grep and nothing shows at all.

    grep 15/10/10 *.log | grep mobile | grep 128

    Please help with this issue and I thank you all in advance for your help.

    Thanks
    Charan
    You have to escape the '/' character by preceeding it with a '\' character. Try this:
    Code:
    cat *.log | grep 15\/10\/10 | grep mobile | grep 128
    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •