To search for a specific text on a Linux system, the grep command can be used according to the following syntax:

grep -iRl "text_to_search" ./

The basic parameters are:

  • i: ignore text case (uppercase or lowercase)
  • R: search recursively in subfolders files
  • l: show file names instead of parts of the file contents

The folder path to be searched is specified last.

The grep command has other parameters that may be useful for searching, such as:

  • n: display the line number
  • w: match all search text

Some examples of grep usage:

grep "" /etc/php/7.2/apache2/php.ini
grep -iRl "memory_limit" /

Previous Post Next Post