0

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

0

1 Answer 1

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/*
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.