GREP

Ace your homework & exams now with Quizwiz!

Where does the name grep come from?

It comes from the ed command g/re/p.

What does the grep command do?

It takes a regular expression pattern and a file specifier, and searches all the files specified for the pattern and prints each line containing a match.

What does it mean the the -r flag will use recursion using grep?

Recursion means that the command will be applied to all files in the directory sub-tree.

What is a regular expression that matches a string of 0 or more z's followed by a string of zero or more x's, in between the characters a and b?

/az * x * b/

What is a regular expression?

A pattern of characters used to match strings of characters in a file.

How do you match groups of characters that may repeat using grep?

Use parentheses around the group.

How do you match a string before the end of a line using grep?

Use the $ character after the match string.

How do you match a string of one or more characters using regular expressions?

Use the + character after the match character.

How do you match a string at the beginning of a line using grep?

Use the caret(^) before the match string.

What is the command to search all files in the current directory for lines that have the string "#include" (without the quotes) using grep?

grep \#include *.*


Related study sets

Social and Behavioral Responsible Conduct of Research

View Set

Nursing Care of the Newborn (Level 1)

View Set

65- 13: Types and Characteristics of Fixed Income (Debt) Securities and Methods Used to Determine Their Value

View Set