grep -l 'pattern' *.txt

Category: Text Processing

grep -l 'pattern' *.txt

List only filenames containing the pattern

Instead of printing matching lines, only prints the names of files that contain at least one match.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.