Skip to main content
grep

grep

1 8.1
A program run from the command line to find lines in files
  • noun
  • /ɡrɛp/
  • Specialized
: grep
  • The grep command is very useful for finding specific text in a large file.

Examples

  • You can wrap your grep into a script, use it in an Automator workflow, and assign this a systemwide shortcut if you wish (I wouldn't do that).

    Blog text (14)
  • From time to time, you can catch Matt pacing the office, grumbling about lack of grep support in Visual Studio or browsing stories on YCombinator's Hacker News site.

    Blog text (23)
  • But in essence, it will stay the good old grep.

    Blog text (14)
  • Great tip on ripping titles from an XML file - I normally do this using echo/grep, etc. in Linux, but this is much more friendly.

    Blog text (22)
  • In order to verify if Apache is executed when the server is restarted, run: $ chkconfig --list grep httpd

    Blog text (3)
  • You could calculate the same using the ps -ef grep snapshot command; however, you would then have to subtract the process start date/time from the server date/time, as shown below.

    Blog text (27)
  • By using grep, you can easily search through log files for errors.

  • Many programmers rely on grep to filter lines of code based on patterns.

Surface Forms

grep singular
greps plural

Etymology

Grep comes from an old editor command written g/re/p, which meant 'global', 'search for a pattern', 'print' — in other words, find matches in all lines and show them. So the program called grep is a tool that quickly finds and displays matching lines in files.