Grep Exercises
Questions and Answers
What is the purpose of Grep?
What are some common uses of Grep?
What character represents the Line Begin Anchor
?
What character represents the Line End Anchor?
?
What is the Any Character Symbol
??
How would you search a file for lines beginning with the phrase John
?
How would you search a directory for only files ending in .csv
?
Working with the user.csv Dataset
Using the user.csv Dataset complete the following requirements:
Note
If you need to get the user.csv
Dataset again you can do so with the following command:
curl -s https://launchcodelearning.org/api/walkthrough/user?data_format=csv > user.csv
Filter the results of the user.csv
so that you only match users by the name of James
with an email ending in .org
that work for Boeing
.
Filter the results of the user.csv
so that you only match users with the last name Campbell
that work for the organization Freedom pay
.
Bonus
How would you filter the results of the user.csv
so that you only match users with the first name John
or Paul
and have a last name beginning with the letter J
or S
that work for the organization Express Scripts
?