Question: Project 3 - 7 ESTIMATED TIME: 3 0 minutes OBJECTIVE: Use regular expressions. DESCRIPTION: In this hands - on project, you use the grep and
Project
ESTIMATED TIME: minutes
OBJECTIVE: Use regular expressions.
DESCRIPTION: In this handson project, you use the grep and egrep commands alongside regular expression metacharacters to explore the contents of text files.
Switch to a commandline terminal tty by pressing CtrlAltF and log in to the terminal using the user name of root and the password of LINUXrocks!.
At the command prompt, type grep "Inn" sample and press Enter. What is displayed?
At the command prompt, type grep v "Inn" sample and press Enter. What is displayed?
At the command prompt, type grep "inn" sample and press Enter. What is displayed and why?
At the command prompt, type grep i "inn" sample and press Enter. What is displayed?
At the command prompt, type grep "I" sample and press Enter. What is displayed?
At the command prompt, type grep I sample and press Enter. What is displayed?
At the command prompt, type grep te sample and press Enter. What is displayed?
At the command prompt, type grep we sample and press Enter. What is displayed?
At the command prompt, type grep I" sample and press Enter. What is displayed?
At the command prompt, type grep I sample and press Enter. What is displayed?
At the command prompt, type grep wenext sample and press Enter. What is displayed? Why?
At the command prompt, type egrep wenext sample and press Enter. What is displayed?
At the command prompt, type grep "Inn$ sample and press Enter. What is displayed?
At the command prompt, type grep $ sample and press Enter. What is displayed and why? Does the metacharacter have special meaning here? Why?
At the command prompt, type grep $ sample and press Enter. Is anything displayed? Hint: Be certain to look closely! Can you explain the output?
Type exit and press Enter to log out of your shell.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
