# phpman > man > qsgrep(1)

[QSGREP(1)](https://www.chedong.com/phpMan.php/man/QSGREP/1/markdown)                                  qsgrep man page                                 [QSGREP(1)](https://www.chedong.com/phpMan.php/man/QSGREP/1/markdown)



## NAME
       qsgrep - prints matching patterns within a file.

## SYNOPSIS
       qsgrep -e <pattern> -o <sub string> [<path>]

## DESCRIPTION
       qsgrep  is a simple tool to search patterns within files. It uses regular expressions to find
       patterns and prints the submatches within a pre-defined format string.

## OPTIONS
### -e <pattern>
              Specifes the search pattern.

### -o <string>
              Defines the output string where $0-$9 are substituted by the submatches of the regular
              expression.

       <path> Defines  the  input file to process. qsgrep reads from from standard input if this pa‐
              rameter is omitted.


## EXAMPLE
       Shows the IP addresses of clients causing [mod_qos(031)](https://www.chedong.com/phpMan.php/man/modqos/031/markdown) messages):

         qsgrep -e 'mod_qos\(031\).*, c=([a-zA-Z0-9:.]*)' -o 'ip=$1' error_log


## SEE ALSO
       [qsdt(1)](https://www.chedong.com/phpMan.php/man/qsdt/1/markdown), [qsexec(1)](https://www.chedong.com/phpMan.php/man/qsexec/1/markdown),  [qsfilter2(1)](https://www.chedong.com/phpMan.php/man/qsfilter2/1/markdown),  [qsgeo(1)](https://www.chedong.com/phpMan.php/man/qsgeo/1/markdown),  [qshead(1)](https://www.chedong.com/phpMan.php/man/qshead/1/markdown),  [qslog(1)](https://www.chedong.com/phpMan.php/man/qslog/1/markdown),  [qslogger(1)](https://www.chedong.com/phpMan.php/man/qslogger/1/markdown),  [qspng(1)](https://www.chedong.com/phpMan.php/man/qspng/1/markdown),
       [qsre(1)](https://www.chedong.com/phpMan.php/man/qsre/1/markdown), [qsrespeed(1)](https://www.chedong.com/phpMan.php/man/qsrespeed/1/markdown), [qsrotate(1)](https://www.chedong.com/phpMan.php/man/qsrotate/1/markdown), [qssign(1)](https://www.chedong.com/phpMan.php/man/qssign/1/markdown), [qstail(1)](https://www.chedong.com/phpMan.php/man/qstail/1/markdown)

## AUTHOR
       Pascal Buchbinder, <http://mod-qos.sourceforge.net/>



mod_qos utilities 11.63                       May 2019                                     [QSGREP(1)](https://www.chedong.com/phpMan.php/man/QSGREP/1/markdown)
