Lab 3-3
To delete all the blank lines at the end of the file, which of the following command should be used? A. sed '/^/d' yumtest.conf B. vi'/^ /d' yumtest.conf C. fgrep'/^ /d' yumtest.conf D. grep '/^ /d' yumtest.conf
A. sed '/^/d' yumtest.conf
Which of the following special characters cannot be used with the grep command unless you use them as metacharacters? [Choose all that apply.] A. ? B. ( C. { D. + E. |
All of the above
Which parameter of the grep command displays the line number of the line that contains the searched text? A. -l B. -d C. -n D. -a E. -q
C. -n
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? A. egrep -c '1|01$' /etc/yum.conf B. egrep -c -^1|01$ /etc/yum.conf C. egrep -c '^1|01$' /etc/yum.conf D. egrep -c '/^1|01$/' /etc/yum.conf
C. egrep -c '^1|01$' /etc/yum.conf
Using the grep command, you want to count the number of lines in which the searched text appears. What parameter should you use? A. -d B. -l C. -n D. -q E. -c F. -a
E. -c