Search text within multiple files in Linux

If you want to search text in multiple files in Linux, you can use the following command.

Example)

If you want to find files containing the word "abcd" under the directory /home/ and its subdirectories:

grep -e abcd /home/ -R

(If you omit the switch '-R', the search will be performed only for the directory /home/.)


Leave a Comment