Question: 1) In linux: Move to the /etc directory. Type less bashrc and step through the contents of this file to see what is in it.

1) In linux: Move to the /etc directory. Type less bashrc and step through the contents of this file to see what is in it. You will explore some lines in this file using grep.1. Enter the command grep if bashrc. This will find every line in the file that contains an if followed by a blank space.How many lines did the statement find? Were any of the lines not actually if statements? (comments start with a #). You can obtain just the number of matches using grep c. Repeat the command using c to make sure you counted correctly! 2. The [ ] work just like we saw in the last lab. In [ ], we place a range of items like a-z or 0-9 or a list like aeiou. The use of [ ] in the regular expression says that the next character of the substring must match one character in the [ ]. Use [ ] to write a grep command that will find every line in bashrc that contains a digit. What command did you come up with? 3. Repeat #2 but find every line that contains a multi-digit number (a number with more than one digit). NOTE: do not use { } for this. What command did you come up with? 4. Use grepc to find all empty lines in the bashrc file, which is represented in a regular expression as ^$.What command did you enter? How many blank lines were found? Explain what ^$ means (dont answer an empty string, explain the role of ^ and $).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!