Grep

From MEPIS Documentation Wiki

Jump to: navigation, search

grep is a command line utility that searches for lines of text that match one or many regular expressions, and returns only the matching lines. The most common use of it is to pipe the output of another command into it so you can find something in particular, as grep will print out any lines which contain the string you give it.

For example, this will print out all the entries from fstab related to hda.

cat /etc/fstab | grep hda

You can get quite elaborate with grep arguments; for more information see the man page (i.e., type "man grep" in a Command line) or the GNU project page.

Personal tools
In other languages