Redhat Linux 9: grep, regular expression, awk, sed

Published: 01 November 2023
on channel: Le Hoang Long Long
27
0

Link playlist
Red Hat Enterprise Linux Administration
   • Red Hat Enterprise Linux 9 Administration  

2023 11 01 23 42 27

Define Key Terms
Define the following key terms from this chapter and check
your answers in the glossary:
pager
regular expression
line anchor
escaping
wildcard
multiplier
Review Questions
The questions that follow are meant to help you test your
knowledge of concepts and terminology and the breadth of
your knowledge. You can find the answers to these questions in
Appendix A.
. Which command enables you to see the results of the ps aux
command in a way that you can easily browse up and down in
the results?
. Which command enables you to show the last five lines from
~/samplefile?
. Which command do you use if you want to know how many
words are in ~/samplefile?
. After opening command output using tail -f ~/mylogfile, how
do you stop showing output?
. Which grep option do you use to exclude all lines that start
with either a # or a ;?
. Which regular expression do you use to match one or more of
the preceding characters?
. Which grep command enables you to see text as well as TEXT in
a file?
. Which grep command enables you to show all lines starting
with PATH, as well as the five lines just before that line?
. Which sed command do you use to show line 9 from
~/samplefile?
. Which command enables you to replace all occurrences of the
word user with the word users in ~/samplefile?
End-of-Chapter Lab
In this end-of-chapter lab, you work with some of the most
significant text processing utilities.
Lab 4.1
1. Describe two ways to show line 5 from the /etc/passwd file.
2. How would you locate all text files on your server that
contain the current IP address? Do you need a regular
expression to do this?
3. You have just used the sed command that replaces all
occurrences of the text Administrator with root. Your
Windows administrators do not like that very much. How do
you revert?
4. Assuming that in the ps aux command the fifth line contains
information about memory utilization, how would you
process the output of that command to show the process that
has the heaviest memory utilization first in the results list?
5. Which command enables you to filter the sixth column of ps
aux output?
6. How do you delete the sixth line from the file ~/myfile?


On this page of the site you can watch the video online Redhat Linux 9: grep, regular expression, awk, sed with a duration of hours minute second in good quality, which was uploaded by the user Le Hoang Long Long 01 November 2023, share the link with friends and acquaintances, this video has already been watched 27 times on youtube and it was liked by 0 viewers. Enjoy your viewing!