Overclock.net › Forums › Software, Programming and Coding › Other Software › Can I exclude a word from a GREP pattern?
New Posts  All Forums:Forum Nav:

Can I exclude a word from a GREP pattern?

post #1 of 2
Thread Starter 
Not sure whether this goes in other software or Linux but...

I'm using Putty to GREP some log text files roughly 15gb to 25gb big. So, I want to grep a specific pattern, but exclude one whole word. Is this possible?

So, for example, I am looking for all entries containing the word "cheese", but want to exclude anything with the whole word "cheeseboard" in. I read somewhere to use -vw parameter, but... i'm not sure how to do this.

So, my very basic grep is:
Code:
zgrep "cheese" log1.2011-10-12.gz

Would this work (I ask prior to trying it because once it is running, it can take hours before anything is found)
Code:
zgrep -v "cheeseboard" log1.2011-10-12.gz | zgrep "cheese"

Halp!?
post #2 of 2
yeah that should work. good luck!
Gertrude
(13 items)
 
  
CPUMotherboardGraphicsRAM
2 x Xeon X5670 EVGA Classified SR-2 2x GTX 470 w/ 8800gt PHYSX (waiting for Kepler) 48GB FB 1333MHz 
Hard DriveOptical DriveOSMonitor
256GB Crucial C300, IoDrive Duo 1TB, 10TB Seagates LG WH10LS30 Windows 7 x64 Dell Ultrasharp U3011 
KeyboardPowerCaseMouse
Leopold Tenkeyless Silverstone ST1500 LittleDevil PC-V8 R.A.T. 9 
  hide details  
Reply
Gertrude
(13 items)
 
  
CPUMotherboardGraphicsRAM
2 x Xeon X5670 EVGA Classified SR-2 2x GTX 470 w/ 8800gt PHYSX (waiting for Kepler) 48GB FB 1333MHz 
Hard DriveOptical DriveOSMonitor
256GB Crucial C300, IoDrive Duo 1TB, 10TB Seagates LG WH10LS30 Windows 7 x64 Dell Ultrasharp U3011 
KeyboardPowerCaseMouse
Leopold Tenkeyless Silverstone ST1500 LittleDevil PC-V8 R.A.T. 9 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Other Software
Overclock.net › Forums › Software, Programming and Coding › Other Software › Can I exclude a word from a GREP pattern?