GNU and Unix commands — page 6
Objective 103 of LPIC-1 Exam 101-500, worth 43.33% of the exam. This is page 6 of 7 of its question list; page one carries the full objective summary.
- Share of the exam
- 43.33%
- Questions in a real sitting
- roughly 26 of 60
- Questions in this bank
- 130
- Signed for by a person
- 0
- Machine-checked only
- 130
Partly checked. None of the 130 questions here has been read against the cited source by a person. 130 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.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
What this objective covers
The 130 questions written for this objective cite 8 LPI exam objectives (103.1, 103.2, 103.3, 103.4, 103.5, 103.6, 103.7, 103.8) and 34 manual pages (bash(1), bzip2(1), cp(1), cpio(1), crontab(1), dd(1), env(1), find(1), getpriority(2), glob(7), grep(1), gzip(1), ls(1), man(1), mv(1), nano(1), nice(1), nohup(1), ps(1), regex(7), renice(1), rmdir(1), screen(1), sed(1), signal(7), tar(1), tee(1), top(1), touch(1), uname(1), vi(1p), vim(1), wc(1), xargs(1)).
They break down as 88 single-answer questions, 18 choose-several questions and 24 type-the-answer questions.
Drill this objective
The trainer can run a short practice set drawn from this objective alone, which is what the weight column above is for: revise the heavy objectives first.
Practise GNU and Unix commands
Questions on this objective (page 6 of 7)
- Type the command, including its option, that lists the current shell's jobs and shows the process ID of each job alongside the usual job number and command. machine-checked
- `ps -ef` shows a process in state Z whose command is displayed as `<defunct>`. Sending it SIGKILL changes nothing. What is happening, and what removes the entry? machine-checked
- Select the TWO statements that are true about SIGKILL and SIGSTOP. machine-checked
- Your SSH connection dropped while a long compile was running inside GNU screen. After logging in again, `screen -ls` lists one session marked (Detached). Which command puts you back into it? machine-checked
- A maintenance shell was itself started with `nice -n 5 bash`, so its nice value is 5. Inside that shell you run `nice -n 3 ./convert.sh`. What nice value does convert.sh run with? machine-checked
- You want to confirm the nice value that a running process is actually using, and you would rather not learn a field list by heart. Which ps invocation shows a NI column by default? machine-checked
- You want to know what nice value your current shell is running with, without changing it. Which command prints it? machine-checked
- While watching top you decide that a running process should be given a less favourable nice value, without leaving top. Which interactive key starts that operation? machine-checked
- As root, type the complete command that sets the nice value of every process belonging to the user bob to 15. Identify the target by user name, not by PID. machine-checked
- A shell has been running a data import for some time. You run `renice 10 -p <shell PID>` on the shell itself, but the import process it started earlier keeps running at nice value 0. Why? machine-checked
- You need to know how many lines of /var/log/auth.log contain the text `Failed password`. Which command reports exactly that number? machine-checked
- Using grep with basic regular expressions and POSIX character class syntax, which pattern matches any line containing at least one decimal digit? machine-checked
- A colleague is surprised that `grep 'ab*c' data.txt` matches a line containing the string `ac`. What explains the match? machine-checked
- You run `sed 's/http:/https:/' urls.txt` and find that on lines holding two URLs only the first was rewritten. Which command fixes it? machine-checked
- You must change 8080 to 8443 inside /etc/app/app.conf, saving the result in the file itself while keeping the original as app.conf.bak. Which command does that with GNU sed? machine-checked
- A configuration file is to be displayed with every empty line and every line that begins with # in the first column removed. Select the TWO commands that do this. machine-checked
- Type the complete command that searches every file below /etc recursively for the string nameserver and prints only the names of the files that contain it, not the matching lines. machine-checked
- Type the complete sed command that prints only the fifth line of data.txt and nothing else, using the option that suppresses sed's automatic printing together with an explicit print command. machine-checked
- You must find lines in /var/log/auth.log that mention root as a complete word, so that chroot and rootkit are not reported. Select the TWO commands that achieve this with GNU grep. machine-checked
- Every run of digits in report.txt is to be wrapped in square brackets, so that `code 42 rev 7` becomes `code [42] rev [7]`. Which command does that? machine-checked
Practise GNU and Unix commands
The other objectives in LPIC-1 Exam 101-500
- 101. System architecture — 13.33% of the exam
- 102. Linux installation and package management — 18.33% of the exam
- 104. Devices, Linux filesystems, filesystem hierarchy standard — 25% of the exam