Filtering text streams
Lesson 2 of 8 in objective 103. GNU and Unix commands, part of LPIC-1 Exam 101-500.
- Objective
- 103. GNU and Unix commands
- Share of the exam
- 43.33% (the whole objective)
- Questions in this lesson
- 9
- Signed for by a person
- 0
Partly checked. None of the 9 questions here has been read against the cited source by a person. 9 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.
Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.
Questions in this lesson
- A file contains one plain integer per line. Sorting it with plain `sort` produces the order 1, 10, 2, 20, 3. Which option makes sort order the numbers by value? machine-checked
- Which command reads standard input and writes it out with every lowercase letter converted to uppercase? machine-checked
- A text file contains several blank lines. Which command numbers only the non-empty lines by default? machine-checked
- Two files each contain 100 lines. You want line 1 of the first file next to line 1 of the second, line 2 next to line 2, and so on, separated by a tab. Which command does this? machine-checked
- In config.txt some lines contain the word `foo` more than once. Which command prints the file with EVERY occurrence on every line replaced by `bar`, leaving the file itself unchanged? machine-checked
- Select the TWO true statements about the uniq command. machine-checked
- Type the complete command that displays the last 20 lines of the file /var/log/syslog. Pass the file as an argument, not through a redirect. machine-checked
- Type the complete command that reports ONLY the number of lines in the file report.txt, passing the file as an argument. machine-checked
- The file /etc/passwd has colon-separated fields. Type the complete command that prints only the third field (the UID) of every line, using cut and passing the file as an argument. machine-checked
Drill this lesson
A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.
Practise Filtering text streams