1. Home
  2. Docs
  3. Beginning UNIX on Raven
  4. Working with text files
  5. Exercises using grep

Exercises using grep

For the following questions, you should come up with both an answer and the command you generated to get the answer.

  1. How many times does the jester appear in our lyrics?
  1. How many times does Jack appear at the start of a line?
  1. What would this command look like if you made it case insensitive?
  1. How many times does dance end at the end of a line?
  1. Combining two grep searches, how many times were ‘we’ singing ‘bye-bye’ to Miss American Pie?
  1. How many times were people saying bye-bye?