Text

Text: grep

Grep is a tool to search for text within files.

Grep stands for Global Regular Expression Print.

grep "Fred" names.txt

Will search lines in the file named names.txt and print any matching lines to standard out.

Can use globs.

grep "Fred" *.md

Will search in all markdown files in the current directory.

Options:

Combining with other tools

A common use case is to pipe the output of other commands to grep in order to search for something specific.

For example, piping the out put of history to grep to see your own commits.

history | grep "git commit"

Tools

Web

Languages

Data