Send by LINE
B! Bookmarks in Hate-bu
Bookmarks in Pocket
RSS feeds

Linux grep: Search recursively within a file

Other language site
No available translations found
Google Translate
programing image

When searching for arbitrary keywords in the file, use the option "r" with the grep command to search including subdirectories.

grep -r search-string [dir | file]

Important here, directory and file patterns can not be used.



This means that we can not use it.

Specify the full name of the directory name, file name, or specify an asterisk (*).

When specifying an asterisk, search all under the current directory.

Leave a Reply