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

  • Thread starter Thread starter Alta
  • Start date Start date
  • Tags Tags
    File
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 23K views
Alta
Messages
13
Reaction score
0
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?
 
Physics news on Phys.org
Use the -v option to grep to invert the search results.

grep -v "text" *