Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Using grep to find a file that does not contain a word.

  1. Oct 15, 2009 #1
    I have a bunch of files that I want to find the ones that do not contain a word. I think that I can use grep to do this but I am not sure. does anyone know how to do this?
  2. jcsd
  3. Oct 25, 2009 #2
    Use the -v option to grep to invert the search results.

    grep -v "text" *
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook