


-B N print matching line and N number of lines before the matched line.-A N print matching line and N number of lines after the matched line.-F interpret pattern as a fixed string (i.e.-L print filenames not matching the pattern.

-l print only the filenames matching the given expression.-c display only the count of output lines.-n prefix line numbers for output lines.-color=auto highlight the matching portions, filenames, line numbers, etc using colors.Examples will be discussed in later sections. Common optionsĬommonly used options are shown below. The most common usage is filtering lines from the input using a regular expression (regexp). The grep command has lots and lots of features, so much so that I wrote a book about it. Its name comes from the ed command g/re/p ( globally search a regular expression and print), which has the same effect. Grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. The example_files directory has the scripts used in this chapter.
#ANTIWORD GREP RECURSIVE SEARCH TEXT HOW TO#
After that, you'll learn how to locate files based on their names and other properties like size, last modified timestamp and so on. This chapter will show how to search file contents based on literal strings or regular expressions.
