How do we use grep to search for a pattern in multiple files?

KellyPoima

New member
How do we use grep to search for a pattern in multiple files?
Answer
To search multiple files with the grep command, insert the filenames you want to search, separated with a space character. The terminal prints the name of every file that contains the matching lines, and the actual lines that include the required string of characters. You can append as many filenames as needed.
 

Tìm kiếm

Back
Top