Linux grep: Search recursively within a file

Other language site
No available translations found
Google Translate
  • ---

    Send by LINE
  • -

  • -

  • -

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.

SNS also distributes articles.
Leave a Reply


If you like this article, share it!