0

How would you use grep to find a file inside a directory that contains a certain string inside it's content.

ijndkgeo
  • 11
  • 5

1 Answers1

0

You can use command like:

grep -lR string directory/*

-l will print only the filename instead of content. -R will do it recursively. If you need to do it only in "directory" remove -R

grep -l string directory/*
Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31
  • You might want to refrain from answering questions which are common FAQs. They usually have a number of duplicates with multiple answers, many of which contain information which isn't in yours. – tripleee Jan 17 '19 at 09:46