grep -v with multiple patterns.

2010-01-25 126 words 1 min read

$ sed '/test/{/error|critical|warning/d}' somefile If you wanted to do all in one command, you could go w/ sed instead

  • <a href="http://www.commandlinefu.com/commands/view/3882/grep-v-with-multiple-patterns.">View this command to comment, vote or add to favourites
  • <a href="http://feeds2.feedburner.com/commands/by/pipping">View all commands by <a href="http://feeds2.feedburner.com/commands/by/pipping">pipping

<a href="http://www.commandlinefu.com"><img src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" alt="" align="bottom" />

by David Winterbottom (<a href="http://codeinthehole.com">codeinthehole.com)

<a href="http://feedads.g.doubleclick.net/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/0/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/0/di" alt="" align="bottom" />
<a href="http://feedads.g.doubleclick.net/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/1/di" alt="" align="bottom" />

<img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/LjKzo7FpzDU" alt="" width="1" height="1" align="bottom" />

URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/LjKzo7FpzDU/grep-v-with-multiple-patterns.">http://feedproxy.google.com/~r/Command-line-fu/~3/LjKzo7FpzDU/grep-v-with-multiple-patterns.<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.seroundtable.com/archives/020935.html">Google&#8217;s &#8221;Show More Results&#8221; Plus Box (seroundtable.com) <li class="zemanta-article-ul-li"><a href="http://www.macworld.com/article/143351/2009/10/netprocesses.html?lsrc=rss_main">See which processes are using the Internet (macworld.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/cc60245b-7397-4d48-83b2-7bfb345ae7a9/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e20.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it