GNU and Unix commands — page 2
Objective 103 of LPIC-1 Exam 101-500, worth 43.33% of the exam. This is page 2 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 2 of 7)
- A directory contains the single file log2024.txt. Select the THREE shell glob patterns that match that file name. machine-checked
- Neither project nor project/src exists yet. Type the complete command that creates the directory project/src/main in a single invocation, creating the missing parent directories as needed. machine-checked
- Select the TWO true statements about output redirection in bash. machine-checked
- The pipeline `find . -name '*.tmp' | xargs rm` fails on file names that contain spaces, because xargs treats each word as a separate argument. Which form handles those names correctly? machine-checked
- Inside a script you want to feed several lines of text that are written directly in the script, ending at a marker word, to a command's standard input. Which redirection operator introduces that construct? machine-checked
- Type the complete command line that runs `dmesg` so that its output appears on the terminal and is written to the file boot.log at the same time. Use a pipe and the standard tool for this. machine-checked
- A colleague reports that `ls` on their account always prints in colour, and you suspect an alias rather than a different binary. Which command tells you whether the name `ls` currently resolves to an alias, a shell function, a builtin or a file on disk? machine-checked
- A vendor's driver package requires you to report the exact kernel release the machine is running, and nothing else. Which command prints only that? machine-checked
- Your bash session keeps thousands of commands available with the up arrow, but after logging out and back in only the last few hundred survive. Which variable governs how many lines are kept in ~/.bash_history when the shell exits? machine-checked
- You have run a long sequence of commands in one terminal and want them written to ~/.bash_history right now, so a second terminal can read them, without closing the session and without discarding the history the file already holds. Which command does that? machine-checked
- In a directory containing several files, you type `echo *` and get a list of file names rather than an asterisk. Which command prints a single literal asterisk instead? machine-checked
- A sort must run with LC_ALL set to C so that it collates byte by byte, but the rest of your interactive session should keep its normal locale. Which command achieves that? machine-checked
- You are in /home/ann/tools, where deploy.sh exists, begins with #!/bin/bash and carries the execute bit for your user. Typing `deploy.sh` returns "command not found". What is the cause, and what runs it? machine-checked
- Type the complete command, including the single option, that prints every field uname reports at once — kernel name, network node name, kernel release, kernel version, machine and operating system — on one line. machine-checked
- Earlier in this session you ran `export EDITOR=vim`. You now want commands started from this shell to stop receiving EDITOR, while the shell itself keeps using the value in its own expansions. Which command does that? machine-checked
- Select the THREE true statements about quoting in bash. machine-checked
- You know there is a command that reports information about the running kernel but cannot remember its name. Which command searches the names and one-line descriptions of all manual pages for the word kernel? machine-checked
- The output of `history` shows the long rsync command you need as entry number 512. Which is the shortest way to run exactly that entry again? machine-checked
- A shell prompt for input must leave the cursor on the same line as the text. Which bash command writes `Continue? ` with no trailing newline? machine-checked
- A partition is nearly full and you have been sent access.log.gz. You need to read its contents on stdout without leaving an uncompressed copy on disk and without destroying the compressed file. 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