grep question

| techie stuff | | Comments (4)

Is there a way to do a big grep (find . -type f -exec grep ...) that will find all of the files that do not contain PATTERN?

4 Comments

J.A.S.O.N. said:

If your pattern is in brackets '[]' you can use the '^' character in front of it.

i.e. grep '^[^a-e]*$' foo.txt will find all lines with single words whose first character is NOT any of a-e.

That's the only thing I could dig up so far. I beliee the find command supports the logical NOT operator '!' If I dig up anything else, I'll let you know.

don said:

grep -v foo - this will kill foo from the pattern string

JB Segal said:

grep -v -l

the -v negates, as Don said, the -l just lists file names.

cygwin grep has a reference to
--exclude=PATTERN

Leave a comment

About this Entry

This page contains a single entry by Lisa published on August 31, 2005 10:39 AM.

Today's quote was the previous entry in this blog.

A cool thing is the next entry in this blog.

Find recent content on the main index.

Me!

Brought to you by the letter "S": smart, silly, snuggly, sarcastic, sassy, shy, sympathetic-ear...

About me... :: memes :: My Amazon wishlist :: My LJ :: My Twitter :: My Flickr :: Photos of me

Blog reading list

Contacts
· AIM, Yahoo!, MSN, Google Talk, LJ Talk... just ask
· Email me

Good Causes

       
Love is love.
Support gay marriage.

platinum.gif
East siiiiiiiiiiiiiiiiiiiide, baby!
Click to help
sponsor mammograms
Listen to good music! Radio Paradise

Silly Stuff

blogchalk:
Lisa/Female/41-45. Lives in United States/Mass/Boston and speaks
English. Spends 80% of daytime online. Uses a Faster (1M+) connection.
The
WeatherPixie
The weather in Boston

Flickr

www.flickr.com
jasra's photos More of jasra's photos
Powered by Movable Type 4.1

Copyright

Copyright © 2001-7 Lisa K Holsberg. Unauthorized use is prohibited.