Issue
grep -nr 'queryTag' .
For example, I have a number of directories in the current directory, and I want to search for the keyword 'queryTag'. However, I want to restrict the search to the file type '.txt', not all the file in the current directory. How to modify the command above?
Solution
You can use --include=
option:
grep -nr 'queryTag' --include='*.txt' .
Answered By - anubhava Answer Checked By - Marilyn (WPSolving Volunteer)