Grep

Why Trust Techopedia

What Does grep Mean?

Grep is a command used in Linux, UNIX and Unix-like operating systems to search text, files or any document for a user-specific pattern, a string of text or a matching character. It displays the matching line on the screen that contains the searched object/objects. Grep is one of the most powerful commands on operating systems like Unix or Linux.

Advertisements

Techopedia Explains grep

The term grep originates from a command in Unix which used to perform a similar operation, g/re/p, which means “globally search a regular expression and print.”

The basic syntax of grep is:

grep [option(s)] pattern [file(s)] Where the given pattern is searched inside the lines contained in the named files. The objects listed inside the square brackets are optional. When the options and input file are not specified, then the grep command searches for standard input (which is by default the standard text typed on the keyboard) and each line that happens to constitute the given pattern is displayed.

Advertisements

Related Terms

Margaret Rouse
Technology Specialist
Margaret Rouse
Technology Specialist

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.