Grep Exclude

Ever wondered how to exclude a string from grep?  Last week I decided to dig until I find the answer, as I had to find a “lost” DB2 script in a pile of archives.  It turns out that grep has a feature called “grep for all except”.  Finally found that on a mailing list archive of COLUG.  Here is how it works:

grep pattern1 file | grep -v pattern2
This entry was posted in AIX, Dedicated Servers, Hosting Support, Linux, Mac OS X, Managed Hosting, OpenBSD, Windows and tagged , . Bookmark the permalink.

NewPush has solutions to fit your business needs.  For more than a decade, our focus has been to take on the technical challenges that are the hardest and most time-consumming.  Our goal is to free up your resources to focus on the core activities of your business and to drive your business performance.  Please visit our main site at newpush.com for more information or call us at +1-303-423-4500.