The grep command which stands for 'global regular expression print' is one of the most powerful and commonly used commands in Linux. Grep searches one or more input files for lines that match a given pattern and writes each matching line to standard output. If no files are specified, grep reads from the standard input which is usually the output of another command. In this tutorial, we will show you how to use the grep command through practical examples and detailed explanations of the most common GNU grep options.
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.