Skip to main content

Grep Linux command

Comments

2 comments

  • rpvw
    grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. There are hundreds of example and tutorial sites for grep if you use your favorite search engine :) As an example, if I wanted to get all the lines in the /var/log/apache2/access_log that contained the string "mod.php?mod=downloads", I could use a command like:
    grep "mod.php?mod=downloads" /var/log/apache2/access_log
    This would output in my terminal potentially many lines of code, so I might pipe the output to a file instead eg
    grep "mod.php?mod=downloads" /var/log/apache2/access_log > myfile
    then I can open or download myfile and deal with it at leisure :-D
    0
  • cPanelMichael
    Hello, Let us know if you have any questions after reviewing the previous post. Thanks!
    0

Please sign in to leave a comment.