Linux Command Line Quiz
Practise Linux command choices and predict their effects with 48 GNU/Linux questions, explanations and retries without executing commands.Practice status
{{ summaryLine }}
{{ quizIssue }}
{{ seedNotice }}
{{ quizSetupValidation }}
{{ progressStatusLine }}
Question {{ quizCursor + 1 }} of {{ questionCount }}
{{ currentQuestion.stem }}
{{ currentResultRow.feedback }}
{{ currentResultRow.explanation }}
Source: {{ currentResultRow.source.reference }} · {{ currentResultRow.source.version }} · {{ currentResultRow.source.license }}
Answer recorded. The correction and explanation will appear in your review at the end.
Review what to practice next
{{ resultLead }}
{{ learningReviewTitle }}
{{ learningReviewLine }}
Missed answer review
-
{{ item.prompt }}
Your answer: {{ item.selected_answer_label }}
Correct answer: {{ item.correct_answer_label }}
{{ item.explanation }}
Source: {{ item.source.label }} · {{ item.source.version }} · {{ item.source.license }}
Topic performance
Which command families need another look? Correct and missed answers are grouped by the topics answered in this round.
Loading topic-performance chart…
{{ quizChartExportStatus }}
Answer ledger
| Question ID | Prompt | Topic | Your answer | Correct answer | Outcome | Explanation | Source | Copy |
|---|---|---|---|---|---|---|---|---|
| {{ row.question_id }} | {{ row.prompt }} | {{ row.category_label }} | {{ row.selected_answer_label }} | {{ row.correct_answer_label }} | {{ row.outcome_label }} | {{ row.explanation }} | {{ row.source ? `${row.source.label} · ${row.source.version} · ${row.source.license}` : '—' }} |
{{ quizLedgerExportStatus }}
A Linux command line can read a report, replace it, or remove it, depending on the command, its options and the shell syntax around it. Reading the whole line matters more than recognising the command name. A useful prediction identifies the arguments the command will receive, where its output will go and which files or processes it may change.
The terminal provides a text interface to a shell, which interprets the commands entered there. Bash, the Bourne Again Shell, handles quoting, variable expansion and connections between commands, while utilities such as grep and tar perform particular jobs. Some commands are built into the shell itself. For example, cd changes the shell's working directory, whereas pwd reports that location.
- Current working directory
- The directory used as the starting point for relative paths. A path beginning with
/is absolute; a name such asreports/day.txtdepends on the current location. The component..refers to a parent directory. - Argument
- A value passed to a command. Options change how the command operates, while operands identify things such as files or search patterns. Quoting can preserve a filename containing spaces as one argument.
- Standard streams
- Standard input supplies data to a command, standard output carries its ordinary output, and standard error carries diagnostics. These streams can go to different destinations rather than all appearing in the terminal.
These distinctions make short commands useful for tasks such as checking a log, counting records, changing file access or inspecting an archive. A pipe feeds one command's output into another command's input, so a filter and a counter can work together. Output redirection instead sends a stream to a file. Confusing the two, or confusing replacement with appending, can change the data rather than merely inspect it.
Command recognition and effect prediction exercise different parts of this knowledge. Recognising a copy command is not enough to decide whether an existing destination will be overwritten. Predicting a text-processing result also requires attention to line endings, matching rules and the exact order of the commands. Similarly, a directory's execute permission means permission to search through it, not permission to run every file it contains.
GNU/Linux examples need an explicit environment because other shells, macOS utilities and BSD utilities can differ. Shell options, aliases, permissions and existing files can also change an outcome. Knowledge practice is educational, not proof of practical competence or safe administration. Hands-on work needs disposable test files, checks of the actual targets and appropriate backups before any destructive action.
How to Use This Tool:
Choose a broad review or a focused command family. The 48 original questions contain six each on Navigation, Files, Text processing, Permissions, Jobs & processes, Archives, Pipes & redirection, and Command safety. Commands and files are hypothetical examples. No shell opens and no command executes.
- Choose a Command family, Difficulty and Practice format. The initial setup uses All command families, Mixed difficulty and Mixed practice. Narrow the difficulty to Fundamentals or Applied, or concentrate on Command recognition versus Output & effect prediction.
- Set Question count and Feedback. The initial round has 10 questions with feedback After each answer. With immediate feedback, read the correction and explanation before advancing. Choose At the end to withhold them until completion. Count choices are 1, 2, 3, 5, 10 and 20 where they fit, plus the selected pool's full size. A single unfiltered family has six questions; the full mixed pool has 48.
Changing the family, difficulty or format can reset an unavailable question count. Recheck Question count after narrowing the selection. If Start practice is disabled, choose the available setup values indicated by the message.
- Enter a Replay seed under Advanced when you need a repeatable round. It accepts up to 128 characters, with surrounding spaces removed. A blank or invalid value uses the fixed default
linux-practice-1, not a freshly random seed. - Select Start practice, read the conditions in each question and choose one of its four answers. Selecting an answer records and locks it immediately in both feedback modes. Use Next question to advance and View results after answering the last question. There is no skipped-question final result or early-finish option.
- Review the missed explanations, then choose the next round. Retry missed starts a new attempt containing only wrong answers from the completed attempt. Replay same seed repeats that round's questions and option order, while Try a new seed starts another seeded round but may repeat questions. Change setup clears the attempt so you can choose a different scope.
Interpreting Results:
During a round, Practice status shows how many questions have been answered. At completion it changes to correct answers out of the round's question count. The progress percentage measures completion, not correctness. Reaching 100% progress does not mean every answer was right.
Missed answer review pairs your choice with the correct answer and its explanation. The Answer ledger includes all questions from the attempt, including correct responses, with their topics and source details. A correct selection is most useful when you can also explain why the competing answers do not fit the stated conditions.
Topic performance compares counts of Correct and Missed answers, not standardised proficiency scores. Short rounds need not sample each family equally, and untested families are not rated. A suggested study focus reflects the family with the most misses in this attempt; it does not establish your weakest subject overall.
A Perfect round means all selected questions were correct and leaves nothing for Retry missed. These are independently written practice questions, not an official exam or a comprehensive curriculum. No pass mark, certification or proficiency band is assigned. Repeating familiar questions or reviewing only earlier mistakes changes what the score represents, so compare the scope and question count before comparing attempts.
Technical Details:
Bash interprets shell syntax before a utility receives its arguments. Quoting affects which characters become data, expansion can replace a pattern with filenames, and redirection connects input and output destinations. A command's documented behaviour therefore needs to be read together with the shell's rules and the stated filesystem conditions.
How Bash handles arguments and streams
Standard input, standard output and standard error are also called stdin, stdout and stderr. Their file descriptor numbers are 0, 1 and 2. The following rules distinguish syntax interpreted by Bash from data passed to a command.
| Syntax | Meaning under the stated conditions |
|---|---|
"$path" |
Expand the variable and preserve its value as one argument, including spaces. |
'$path' |
Pass the literal characters $path, not the variable's value. The enclosing quotes are removed. |
* |
Expand matching filenames. With ordinary defaults and dotglob disabled, names beginning with a dot are omitted. |
< |
Read standard input from the specified file. |
> |
Send standard output to a file, creating it or truncating an existing file when the redirection succeeds and noclobber is disabled. |
>> |
Append standard output to a file, creating it if it does not exist. |
2> |
Redirect standard error rather than standard output, with the same ordinary overwrite risk as >. |
| |
Connect the preceding command's standard output to the following command's standard input. A plain pipe does not also redirect standard error. |
Redirections are applied from left to right. With > run.log 2>&1 after a command, standard output first goes to the file, then standard error duplicates that destination. Reversing the order to 2>&1 > run.log leaves standard error at standard output's previous destination. These examples assume an ordinary writable destination and noclobber disabled.
With set -C, Bash enables noclobber. Ordinary > redirection to an existing regular file then fails instead of truncating it. That is a specific redirection safeguard, not general protection against deletion, copying over files or other destructive commands.
Exit status and process control
An exit status is a number returned by a command, separate from anything it prints. Zero denotes success for shell control flow. The command after && runs only if the preceding command succeeds. With pipefail disabled, a pipeline takes its last command's status, so false | true returns 0 despite the earlier failure. The value of $? reflects the most recently completed foreground pipeline when the expansion occurs.
A trailing & starts an asynchronous command without making the shell wait for it to finish. In an interactive shell with job control enabled, jobs -l lists that shell's jobs and process identifiers (PIDs), not every process on the system. A valid stopped job can be brought to the foreground with fg. When the specified child terminates and no signal interrupts the wait, wait returns that child's exit status. Bash kill sends SIGTERM, a termination-request signal, by default; successful delivery does not prove that the process has stopped.
Permission bits and file creation
Ordinary Unix permissions distinguish the owner, the file's group and other users. Each class has read, write and execute bits. Octal notation combines their values into one digit per class, in owner–group–other order.
| Bit | Value | Meaning |
|---|---|---|
r |
4 | Read permission. |
w |
2 | Write permission. |
x |
1 | Execute permission for a regular file, or search permission for a directory. |
Mode 640 grants owner read/write, group read and no ordinary permissions to others. For a regular file with no special bits or access control lists (ACLs), chmod g+w file changes 640 to 660 by adding group write. The + operator adds permissions without replacing the other ordinary bits; = sets the selected class's permissions rather than simply adding them.
A file-creation mask removes permissions from the mode an application requests. With requested mode 666, umask 027 and no default ACL, group write and all other-user permissions are removed, leaving mode 640. This is bit masking, not decimal subtraction. Existing files are not retroactively changed by setting the mask. Actual access can also require search permission on the directories in the path, so a file's three digits alone do not settle every access question.
File effects, text rules and archives
Whether a file already exists affects several common commands. For an existing ordinary writable file, touch updates timestamps without emptying the contents. A successful mv old.txt new.txt, where the new name does not exist, renames the file instead of leaving an independent source copy. GNU cp -i requests confirmation before overwriting an existing destination. These are different effects even when the same filenames appear as operands.
Text commands also operate on specific units. GNU wc -l counts newline characters, not visual rows in an editor. uniq combines adjacent matching lines, not every repeated value throughout the input. sort -n requests numeric ordering. With grep -F, punctuation in the pattern is literal; quoting a pattern protects it from the shell but does not, by itself, disable regular-expression matching inside grep. Adding -v selects nonmatching lines.
For GNU tar, -t lists stored member names, -c creates an archive, -x extracts, and -f supplies the archive name. A listing is not the file contents. Combining extraction with -O sends member data to standard output instead of creating the extracted file. Ordinary extraction leaves the source archive intact, but can overwrite destination files. An untrusted archive needs inspection and an isolated empty destination with minimal privileges; a listing alone does not establish that extraction is safe.
Deletion needs a separate check of the target. GNU rm -i requests confirmation, while -- ends option parsing so a leading dash in a filename is not read as an option. Quoting and ending option parsing solve different problems. Removing a file with rm does not move it to Trash, and a confirmation prompt does not replace checking the name and backup.
Score and progress calculations
Each correct selection earns one point and each incorrect selection earns zero. There is no partial credit, weighting or negative marking. Let C be correct answers, A be answered questions and N be all questions selected for the round. The counts are integers with 0 ≤ C ≤ A ≤ N and N ≥ 1. Score points range from zero to N.
Accuracy measures correct answers against the entire planned round, while progress measures how much of that round has been answered. Unanswered questions remain in the denominator but are not counted as incorrect or included in missed-question retries. Accuracy is calculated without intermediate rounding. The visible progress label uses the nearest whole percent, with half-percent ties rounded upward. The final correct/total count remains exact.
For example, a completed six-question round with five correct answers has five points out of six, approximately 83.33% accuracy and 100% progress. Before completion, one correct answer in a planned ten-question round represents 10% accuracy and 10% progress, not a final 100% result.
Feedback timing changes when corrections are shown, not the scoring rule. Question selection is seeded and without replacement within a round. The same scope, count, feedback setting, seed and question-set version reproduce the questions and option order. The full question set contains equal numbers from each family, but shorter rounds are not selected to guarantee that balance.
The question set declares a documentation baseline of Bash 5.3, GNU Coreutils 9.11, grep 3.12 and tar 1.35, with a verification date of 11 September 2026. Examples assume Bash, standard GNU utilities, no aliases or custom functions, and the C locale for text interpretation unless stated otherwise. These are the stated reference editions, not a check of installed software or a claim to cover every command, platform variation or certification objective.
Privacy Notes:
Scoring happens in the browser, but the page address carries the setup, seed, selected answers and current position, including a partially completed attempt. Someone receiving that address can restore the recorded choices. The address may also enter browsing history or be transmitted when loaded or shared, so a replay seed should not contain credentials or personal details. This address is not encrypted or private progress storage.
Change setup clears the current attempt and removes it from the current page address. It cannot erase links already shared or copies retained elsewhere. There is no account-based progress record.
If Saved attempt unavailable appears, the saved information is invalid or incompatible with the current questions. The quiz returns to setup. Choose the available values and start a new round.
Page and chart resources can still require network requests. Browser scoring is therefore not a promise of offline operation or zero transmission. The quiz does not specify website-wide logging or retention practices.
Worked Examples:
Two visible rows, one newline
A round using Files, Applied and Output & effect prediction contains just one question, about a file with exactly A, a newline and B, with no final newline. For wc -l < sample.txt, select 1. Input redirection supplies the file's bytes to the counter, and only the single newline is counted. Selecting 2 instead produces a missed-answer explanation about newline counting, not an error in the file.
A focused retry after a text-processing round
A two-question round using Text processing, Applied and Output & effect prediction contains a uniq prediction and a cut prediction. Selecting x then y on two lines for printf 'x\ny\nx\n' | uniq is wrong because the separated final x remains. Selecting 42 for printf 'ada:42:ops\n' | cut -d: -f2 is correct because fields are numbered from one. The completed result is 1/2. Retry missed then contains only the uniq question; answering it correctly yields a separate 1/1 attempt rather than changing the original result to 2/2.
References:
- GNU Bash manual page, GNU Project, reproduced by Debian.
- GNU chmod — symbolic and numeric permissions, GNU Project, reproduced by Debian, June 2025.
- umask — file-creation permission mask, Linux man-pages project, reproduced by Debian, 2 May 2024.
- GNU wc — newline, word and byte counts, GNU Project, reproduced by Debian, June 2025.
- GNU uniq — adjacent repeated lines, GNU Project, reproduced by Debian, June 2025.
- GNU cut — selecting delimited fields, GNU Project, reproduced by Debian, June 2025.
- GNU grep — pattern matching and line selection, GNU Project, reproduced by Debian.
- GNU rm — removal and confirmation options, GNU Project, reproduced by Debian, June 2025.
- GNU tar — archive operations, GNU Project, reproduced by Debian.
- GNU tar tutorial — extracting untrusted archives (section 2.8.4), GNU Project.