Lab 3-3: Search Text Files Using Regular Expressions: Linux installation and configuration
To delete all the blank lines at the end of the file, which of the following command should be used?
sed '/^ / d' yumtest.conf
Using the grep command, you want to count the number of lines in which the searched text appears. Which parameter should you use?
-c
Which parameter of the grep command displays the line number of the line that contains the searched text?
-n
Which of the following special characters cannot be used with the grep command unless you use them as metacharacters? [Choose all that apply.]
All (select all of them)
To count the number of lines in /etc/yum.conf that either start with 1 or end with 01, which of the following command should be used?
egrep -c '^1|01$' /etc/yum.conf