GNU and Unix commands — page 3
Objective 103 of LPIC-1 Exam 101-500, worth 43.33% of the exam. This is page 3 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 3 of 7)
- You must duplicate /srv/www to /srv/www.bak so that the copy keeps every file's ownership, permissions and timestamps, recurses into subdirectories, and stores symbolic links as links rather than as copies of their targets. Which command does all of that? machine-checked
- You are renaming report.txt to report.old and are not certain whether a report.old already exists. Which command performs the rename but asks for confirmation before overwriting an existing destination? machine-checked
- The path archive/2023/logs is empty, and so are its parents archive/2023 and archive once it is gone. You want all three removed in one command, and the command must stop with an error rather than delete any directory that still has something in it. Which command do you run? machine-checked
- A script refreshes the timestamps of log files but must never bring a missing file into existence. Type the short option for touch, including its leading dash, that suppresses the creation of files that do not already exist. machine-checked
- Select the THREE true statements about GNU find's time-based tests. machine-checked
- An audit asks for every regular file under /srv larger than 100 MiB. Which command produces that list? machine-checked
- A tree under /var/www contains roughly 200,000 files whose mode must be set to 644. You want find to do it while starting as few chmod processes as possible. Which command meets that requirement? machine-checked
- You have site.tar.gz in your home directory and need its contents unpacked under /opt/site, without changing your working directory first. Which command does that? machine-checked
- Type the complete tar command that creates the bzip2-compressed archive /backup/etc.tar.bz2 from the directory /etc, using single-letter options. machine-checked
- Select the TWO true statements about dd. machine-checked
- You want to archive every file under /etc with cpio, feeding it the list of names produced by find. Which command builds the archive? machine-checked
- The file dump.sql.bz2 is in the current directory. Type the complete command, using no options at all, that decompresses it back to dump.sql. machine-checked
- Select the THREE true statements about ls options. machine-checked
- A directory holds file1.txt, file2.txt and file10.txt. Which glob pattern matches the first two but not file10.txt? machine-checked
- A cron entry runs a maintenance script under /bin/sh (dash on this Debian host) and must never generate mail: neither its normal output nor its error messages may reach cron. Which ending to the cron command line discards both streams reliably on that shell? machine-checked
- A nightly backup script should record its progress messages in /var/log/backup.out and its error messages in a separate file, /var/log/backup.err. Which command line does that? machine-checked
- As an unprivileged user you run `sudo echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/99-fw.conf` and the shell answers with a permission error, even though sudo works for other commands. Which command line writes the file successfully? machine-checked
- A build is run as `make 2>&1`. Every line of the combined stream must be added to build.log, which already holds the output of earlier builds and must not lose it, and the same complete stream must still reach `grep -i warning`. Which pipeline does this? machine-checked
- The file list.txt holds one file name per line. For each name you need to run `mv <name> /archive/`, so the name from the input has to appear before the destination, not at the end of the command line. Which command line does that? machine-checked
- In a cleanup script the line `grep -l OBSOLETE *.conf | xargs rm --` occasionally fails with `rm: missing operand`, because grep matches nothing and GNU xargs runs rm once anyway with no file names. Which GNU xargs option stops the command from being run at all when the input is empty? 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