Skip to content

Searching using grep and find

Jason Charney edited this page Feb 27, 2015 · 1 revision

TODO: This page has yet to be written. But it is important.

grep

There are many tools for searching for a string of text when calling the contents of a file or seeing a list of files. But the one that sticks out the most for many Unix and Linux programs is grep. grep is used a lot like less, only instead of browsing through a file, you return a filtered list of all the lines that match a string. This string can be just a quoted string or a regular expression. grep also has a feature where you can highlight the strings that matched your search. Like sed, grep has influenced the design of a lot of programs and some languages with its straightforward approach to string matching.

Using grep

Often times we will us grep following a pipe command to filter data.

find

find is a lot different than grep. find is for looking for files with certain parameters rather than text, such as when it was created or modified. In addition, find can be used to execute a set of commands.

TODO: Examples SVP!

find and xargs

See also

  • [Textbending with Regular Expression](Textbending with Regular Expression)
  • [The Bash Brothers sed and awk](The Bash Brothers sed and awk)
  • [Download using curl and tar][Download using curl and tar)
  • [Browsing with less](Browsing with less)
  • [Piping with tee and parallel](Piping with tee and parallel)

External Links

Clone this wiki locally