Lab 3-3 Virtual Machine Labs Flashcards

1
Q

Which parameter of the grep command displays the line number of the line that contains the searched text?

A

-n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Using the grep command, you want to count the number of lines in which the searched text appears. Which parameter should you use?

A

-c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following special characters cannot be used with the grep command unless you use them as metacharacters? [Choose all that apply.]

A

All (select all of them)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly