Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 3: Linux Basic Commands

AWS Cloud

3.9 Getting help

Friends, you don't need to memorise every command – help is built into Linux. Learn to use man, --help and apropos, and you can teach yourself any new command.

man 1 ls
whatis chmod
apropos checksum
type cd
help cd
command -v nginx

Run the lines separately. If man uses less, press /, enter a search word and press q to leave the page after reading. GNU ls provides ls --help for quick usage. Check your own implementation if it rejects that option.

Ravindra Bagale's Tip

Before editing an important configuration, identify its exact inputs and use the owner’s versioned backup and recovery procedure. Verify the saved copy first. In a practice directory you can compare a sample with its copy using cmp. A running service may also require separate validation and a controlled reload after a restore.

Ravindra Bagale's Tip

First identify the command your shell resolves. If Bash reports a built-in, try help. For an external command, check its manual and supported short help. If command -v nginx has no result, Bash could not resolve that name in the current shell. Check the actual installation and search path separately.

Lab

Chala, try whatis chmod, type cd, help cd and command -v nginx. Explain each result in one line and identify what your check can tell you. Then look up -f in man 1 tail without running the live follower.

Find the instructions for the command you actually have

Mauli Dairy's new trainee wants to make a small handover list. The three report files have different modification times. The trainee wants oldest first and one filename on each line. An example from a website uses two long options that work on the trainer's Linux host. The trainee's laptop rejects one of them. A second answer uses a command with a similar name but offers a completely different output format. Before adopting either command, the trainee needs to determine what their own shell will run and check the instructions for that particular tool.

Getting help in the terminal is a repeatable workflow. Start with what you want the command to do, identify its implementation and find the relevant section of its documentation. Then test only the smallest example that could answer your question. The three-file exercise here lets you observe the result without editing a real configuration or reading a sensitive log. When the behavior is clear, record which environment your result came from. Another learner can then tell whether their machine is likely to behave the same way.

Different questions send you to different types of help. You may know the command name and need one option. You may have a plain-language task but no command name. A word such as cd might belong to the shell itself. You may have a program path, yet the same name could resolve differently in another terminal. You may have a command that runs successfully and still need to understand why its output looks wrong. Use the following examples to connect each question to the evidence that helps answer it.

Run the lesson in Bash on your own learning machine. The simple directory checks and most sample commands also work on a Mac. Some Linux manual pages and GNU options will only exist on Linux or where those tools have been installed. If a reference command is absent, use the illustrative output for that part. The hands-on work only needs a writable location under your home directory. None of the documentation checks requires administrator access.

Ask Bash how it resolves the command name

When you type a simple name, the shell interprets it before a program receives any options. A name can stand for a shell alias, a function, a built-in command or an executable found in a search path. An alias supplies a replacement from your interactive settings. A function can run a small body of shell work. A built-in is implemented in the shell itself. An external executable lives at a filesystem path. The help you need depends on which kind of name it is. Check the answer in the terminal where you intend to use it.

type cd
type -a ls
command -v grep
printf '%s\n' "$BASH_VERSION"
cd is a shell builtin
ls is aliased to 'ls --color=auto'
ls is /usr/bin/ls
/usr/bin/grep
5.2.37(1)-release

The sample shows three different observations. Bash recognizes cd as one of its built-ins. Its interactive settings may expand ls to include an option. It can also find an external ls binary. command -v grep reports how the name would be resolved in this example. Your output may show different paths, no alias or more than one external executable. Check the first usable choice and any preceding shell definitions. The shell version line only describes Bash. It does not give the version of every utility it launches.

A shell built-in such as cd has help in Bash. It needs to run inside the shell whose working directory it will change. A separate program could change its own directory and finish, while the calling shell's location would stay where it was. Bash's help cd describes the built-in and its options. A system manual for a same-named command or for another shell can offer related information, but its usage need not match this invocation. help here is a Bash feature. A different shell has its own facilities.

help cd
help type

If the option is part of an external implementation, identify that implementation before trusting a specific version flag. Many GNU programs support --version and --help. Other tools can use different flags or treat those words as invalid. For example, common BSD-derived tools on macOS need not accept the same long options as GNU Coreutils. Use an exact binary and its local manual when diagnosing that difference. A search-path utility that reports an executable location can help, but for a Bash alias or built-in use the shell's own view. Learn the command's identity first and look up the relevant manual next.

Choose the right manual section and read it in order

A manual page is a reference entry installed or supplied for a command, programming interface, file format or other system topic. The number attached to its name is its section. In many Linux manual collections section 1 describes user commands, section 2 covers system calls used by programs, section 5 covers file formats, and section 8 covers administrative commands. If two entries have the same name, read the section that answers your question. Someone asking how to enter a command at the shell usually wants an executable command or shell reference. Someone writing a program may need the library or kernel interface instead.

man 1 ls
man 5 passwd
man 1 passwd

Open these separately. The first page should describe the listing command in the set of manuals your system has installed. The second can describe the layout and meaning of the account record on Linux. The third can describe an account password command. Reading the page never invokes the command it documents. A learning image can omit one or more manual entries, and a non-Linux system may use a different filename or layout. The head of the page displays the title and section, which supplies more context when you cite an option to a teammate.

Start with NAME to check what the page covers. The SYNOPSIS gives common forms of invocation. One or more description and option sections explain what each form does. Find an example if there is one. Read the exit status and notes where your plan needs to distinguish empty output from an operational error. A short option definition can refer to other options or say that the default changes in combination. Read the neighboring sentences, especially when the command can change data.

Many manual readers use a pager, an interface for reading one screen of text at a time. With a pager such as less, scroll with ordinary keys or press the slash key, type a search term and press Enter. For the file listing, try searching for sort. Press n for another match and q to exit. If the program uses a different pager, the navigation keys may differ. A quick command lookup and the task you plan to perform are separate terminal actions. Practise exiting the documentation view cleanly so you can return to your shell for the actual test.

As a small second example, look up man 1 tail and search for the section that describes following a file. From that help, explain what a follower waits for and the effect of giving it a line count. You can learn this without launching a never-ending example on a real server. It is useful to note options that explicitly start a wait and to identify how to exit a live view before you run it. The local version may also distinguish following an open file from tracking a name through a replacement. A short how-to can omit that detail while the reference explains where it applies.

Translate a syntax diagram into one command you understand

Manual pages often use brackets for optional elements, ellipses for repetition and a vertical bar for alternatives. Formatting can distinguish the words typed literally from the names that stand in for required data. A terminal page may display the distinction with bold or underlining. An argument written as a placeholder such as FILE usually means substitute the path you have chosen. The brackets are part of the documentation notation. Use the help's examples and option description to interpret how an option takes a value and whether multiple options can be combined.

Consider a generic form written as viewer [OPTION] FILE.... Read it as a command named viewer, possible switches and one or more file operands. The lesson does not depend on an installed command called viewer. In a real example, if a tool has an option that accepts a line count, find out whether that value follows a space or is part of the same token for the chosen option form. Know which part is the option and which is the data. If a filename contains a space, shell quoting preserves it as one argument before the program sees it. Look up quoting in the shell's help system.

Take the working listing task. The trainee needs one name per line and needs modification times sorted from oldest to newest. In the documentation for a suitable ls implementation, the digit-one option requests one entry per line. The time option sorts by the selected time, normally modification time and newest first without other time modifiers. The reverse option flips the chosen ordering. The resulting combination is -1tr. Write the purpose of each character. The number one can look like a lowercase L in some fonts. The different option changes the output format.

A synopsis bar means choose among forms in that reference context. A bar in a shell command normally creates a pipeline between two commands. Similarly, three dots may mean a placeholder can repeat in the synopsis, while entering dots literally gives the tool an operand or a string. Context tells you what to type. Some options also depend on being in a particular position, such as options recognized by the manual viewer before a topic name. Replace every placeholder consciously, and read the documented placement before relying on examples from another implementation.

Where supported, an end-of-options marker can separate options from later operands. For example, a file with a name that starts with a dash can otherwise be interpreted as an option by a command. An explicit path such as ./-report.txt starts with a path component and avoids the ambiguous first character for many tools. Literal pattern arguments need their own care. Shell quoting preserves a string through shell parsing, while a program such as grep can give special meaning to characters inside that string under its pattern rules. Identify both levels before deciding whether to quote or choose a different option.

Discover a name when you know the task

A colleague asks you to find a command that calculates a checksum. A checksum is a value computed from the file's bytes. It can help compare whether copies have the same contents when the method and expected value are suitable. If you do not know a command name, the manual index can look at short descriptions. With man-db tools, apropos checksum searches indexed manual names and descriptions for the word or pattern you supplied. Its related form is man -k checksum. The results give you candidate topics, each with a section number and short description.

apropos checksum
whatis ls
man -w 1 ls

These commands answer three distinct questions. A keyword query finds related manual entries. An exact-name description lookup, whatis ls here, gives the short description for entries with that name. The path query asks the manual tool to show where it finds a particular page. The paths for manuals and executables are related by installation layout, but they are separate pieces of evidence. A manual lookup can pick up a page from another installed copy or an older manual search directory. Use both the executable lookup and the reference identity when debugging a version mismatch.

The search index can be absent or out of date. A workstation can have many manual pages while a compact container image installs only the command files. Some images omit the viewer. A keyword can also fail simply because it differs from the terms used in the short description. Try a narrower or broader related word, a direct page lookup and the installed command's supported short help. For example, look for both “permissions” and “mode” in searching for commands that change access. Report which searches you tried rather than assuming a tool cannot be installed because one index returned no match.

If you go online, prefer the operating system's or tool project's documentation for the relevant version. Match the command name, version, environment and expected options. A current development manual can describe functionality that your older installed version does not support. A distribution may package an upstream tool with its own changes. Use the local help to confirm an option when available, and make a small test to establish whether the target tool behaves as the source describes. For a future reader, link the reference and state the exact command version or operating system release you checked.

Prove the sort order with three known modification times

Use a fresh practice location and three invented reports. We will give the files clear modification times so the expected order does not depend on what second you typed each command. The file names also put ordinary alphabetical order in a different sequence from the time order. The sample names include a space, so you can see how quoting matters when you pass an exact path. Work in the shell that has the documentation you checked. The following setup creates only its own sample files.

help_lab=$(mktemp -d "$HOME/command-help-lesson.XXXXXXXX") &&
  cd -- "$help_lab" &&
  printf '%s\n' 'Morning dispatch report' > './morning report.txt' &&
  printf '%s\n' 'Afternoon dispatch report' > './afternoon report.txt' &&
  printf '%s\n' 'Evening dispatch report' > './evening report.txt' &&
  touch -t 202401010800 './morning report.txt' &&
  touch -t 202401011300 './afternoon report.txt' &&
  touch -t 202401011900 './evening report.txt' &&
  pwd && ls -l

Verify that the working directory printed from setup has the unique lesson name. If setup printed an error, stop and resolve that before moving on. The timestamps are three hours-of-day choices on the same sample date, all represented in the local time zone used by the tool. A filesystem may display dates differently from the input. We care about their relative order. Use the exact file names shown by the listing and note that these are sample times, unrelated to the real report schedule.

LC_ALL=C command ls -1
LC_ALL=C command ls -1t
LC_ALL=C command ls -1tr

The plain output should order the sample filenames afternoon, evening and morning, with one entry per line. With time sorting, it should show evening, afternoon and morning. Reversing that order should give morning, afternoon and evening. We used a temporary locale setting for the command invocation to keep the simple name comparison predictable for this example. The command prefix helps run the normal utility without a same-named shell function or ordinary alias substituting extra behavior into this example. Do not assume that all output formatting follows the same locale rules in every tool. Read the visible result.

Now explain the result in a way that identifies which option mattered. The first line establishes the alphabetical comparison. The second switches the sort criterion to modification time. The third keeps the time criterion and flips the order. If the outputs look the same, check that the files have the intended distinct modification times and that you are listing the intended lab directory. A long listing sorted by time can help verify which item is currently newest. There is no reason to change permissions or install a package just because the files were created too close together to distinguish the order in an unrelated example.

Try an independent prediction. In your disposable lab, use the manual for touch to verify the date option's format and give the morning file a modification time that comes after the evening file. Re-run the same three listing commands. Alphabetical order should remain the same. Time sorting should change. This experiment takes the reference from a sentence to a testable effect. You can report what changed and what remained stable because all three command lines stayed fixed while one file timestamp changed.

Check which layer interprets punctuation and empty results

The handover note also needs to identify a precise route mentioned in a sample log. The literal route text contains a period in /report.v2. A normal basic regular expression can use a period as a one-character pattern. A search in that mode may also match /reportXv2. A fixed-string option asks the program to take the period as the literal character. Quoting a shell argument keeps it together and can protect it from shell expansion. It does not by itself choose grep's pattern interpretation. Look at both places if a match contains unexpected rows.

if [ -n "$help_lab" ] && [ "$(pwd -P)" = "$(cd -- "$help_lab" && pwd -P)" ]; then
  printf '%s\n' '08:10 /report.v2' '08:11 /reportXv2' '08:12 /summary' > ./route-example.txt
fi
grep -n -- '/report.v2' ./route-example.txt
grep -nF -- '/report.v2' ./route-example.txt

The regular expression lookup normally shows lines one and two. The fixed-string lookup should show only line one. The line number option gives you a quick way to refer back to the result. In the second invocation, the fixed string occurs within the first line, so the line is printed. If your task instead requires matching a complete line, look for the complete-line option in the same documentation. Define whether a substring, exact field or full line is the real requirement before you select a flag. Otherwise a command can appear to work on a simple sample while misclassifying real records.

Check what no output means by searching for a route absent from this short fixture. Under GNU grep, a status of zero means at least one line was selected, one means no lines were selected and two generally means an error. Another implementation can use a different larger error status. Read the diagnosed error text if it occurs. Capture the status immediately. A later printf, ls or status check from a different command would replace it. Also keep a missing file attempt separate from an empty result in a real data file.

if grep -nF -- '/unknown' ./route-example.txt; then
  grep_status=0
else
  grep_status=$?
fi
printf 'Search status: %s\n' "$grep_status"

The search should return status one. It successfully read the controlled file and found no matching rows. In your note say “no route match in the three-row training fixture” so the result has a scope. If the command says it could not open the path, you have evidence about file access and no reliable result about the route. A bare output line count cannot make this distinction for you. Use the documentation's status interpretation to write a more accurate diagnosis.

To clean the lab, check that its path is your current location and compare its contents against the four named practice files. The removal below asks before deleting each file. The empty directory removal will refuse any additional contents. Answer the prompts only for the fixture files you recognize. If one fixture step failed and a file is absent, inspect the directory and clean up the exact remaining files individually.

pwd
ls -la -- .
if [ -n "$help_lab" ] && [ "$(pwd -P)" = "$(cd -- "$help_lab" && pwd -P)" ]; then
  rm -i -- './morning report.txt' './afternoon report.txt' './evening report.txt' ./route-example.txt &&
    cd -- "$HOME" &&
    rmdir -- "$help_lab"
fi

Use the first meaningful error to pick a reference

A shell message such as command not found means your shell could not resolve that name in the current context. First check exactly what name you entered and compare it with the executable or built-in lookup. A package could be absent, use a different binary name or exist outside the current search path. The system may be using another shell from the one you assumed. If the executable is found and it responds with unknown option, the problem has changed. Now you have evidence that an implementation started. Identify that version and look up the option it accepts, including case and placement.

A diagnostic about a missing file generally points to the operand and current directory. A sentence about a denied file open can involve path permissions and the user who attempted to open it. A command may also recognize all options and produce reasonable output that simply answers a different question from the one you asked. For example, alphabetical listing can look plausible even when it ignores the date rule you needed. Write the desired input and expected result, then select a fixture whose output makes a mismatch obvious. If the test's expected result changes under different locale or timestamp settings, record those settings when you share it.

Here's a practical situation. Your partner has ls available and says their terminal will not accept a long sort option from a Linux guide. First learn which path Bash resolves. Check whether it is the system's usual tool or an independently installed one. Then consult the manual and test whether the documented short options produce the needed result on the three sample files. If both environments agree on those options, you can write a shorter portable instruction for the team. If differences remain, write one verified example per supported environment. State which input made the difference detectable.

For a second case, a colleague searches for their Python package tool in a local manual index. The index has no result, but the program is present in a particular project environment. Identify the environment where the program runs, then use its supported version and help flags or the project's documentation. A global FAQ might explain a newer release, and activating another project can give you a different binary. If the team depends on a particular behavior, record the project environment and tool version with your reproduction. This gives a maintainer enough context to confirm the result without changing the whole machine.

When you ask for help from a person, include the exact command as safely shareable text, its first relevant error and the environment. Remove private keys, password strings, customer data and sensitive paths from messages that will be shared. Replace data with a representative fixture that still shows the result. Tell the teammate what you expected and which reference you read. “The local man page for this tool describes the short form. The long form is rejected by the installed implementation. The three-file test succeeds with the short form” identifies the issue much better than “Linux doesn't work.”

Use the reference to check what a command displays and what it changes

One of the most useful questions to ask of an unfamiliar command is whether its normal operation only reads information or also changes system state. A line that begins with a familiar tool can conceal surprising effects in an option, operand or adjacent shell operator. Read the description and option sections before using it with real inputs. The command description can say it lists files, changes modes, saves state or starts processes. The synopsis shows the order and roles of the arguments. Taken together these give you a concrete model of which paths should be affected.

Our example listing command is intended for human inspection. It prints names, and can be affected by locale, output format settings or whether its output goes to a terminal. A classroom demonstration contains three filenames with simple characters, so one printed name per line is easy to compare. Real filenames can contain unusual punctuation and even newline characters. A human-friendly listing cannot always provide a safely delimited stream for a script. If your task eventually needs automation, read the tool's available machine-readable forms or use a program designed to enumerate paths with an unambiguous delimiter. Ask for the output format the receiving program expects before chaining the tools together.

Consider ls -ld sample, where sample is a directory. The -l requests the detailed format and the -d makes the command describe that directory as an object. If you remove the second option, it normally describes the entries inside. The output can have similar pieces of information even though it answers the question for different paths. Consult the reference and make a before-and-after reading from two harmless commands. If the support ticket asks whether the web worker can traverse a directory, the mode of the directory itself is the relevant first observation. The purpose described in the note tells another learner which option matters.

File listing also has a typical hidden-name rule. The default listing often skips names beginning with a dot. An option for including them may add the special entries representing the current and parent directories. There is a closely related option to include other dot-prefixed entries without those two. Choose according to the intended output. To test the idea without changing an actual project, compare the manual signatures first. Predict the visible output for a directory containing three ordinary filenames and one dot-prefixed name, then compare the two listings. If a hidden application setting accounted for the original incident, make sure your test tests visibility and keeps its contents private.

An operator after the command can also change what happens. A line with an output redirection can create or replace a destination file even if the program normally just prints information. A documentation lookup for the command alone may not describe that behavior because Bash handles it. In a shared runbook, spell out whether the saved destination can already exist and whether the plan uses a new filename. If you only need to inspect the output, leave it on the terminal until you can explain exactly which file a redirection would open. Look up shell operators in shell documentation.

Review a sample instruction. “List the directory mode, file sizes and output order, then save the sample observation.” It contains several choices. Which command describes the directory object? Which view reports the sizes of its contents? Are these observations sorted by name or by time? What output file is safe to create? Label the expected fields and choose a separate small command for each question. Use a known temporary output path if you need to practise redirection. The same reasoning helps you recognize when a pasted one-liner bundles several decisions that deserve to be checked individually.

The person reading your instructions may be looking at another version. Include the reference section and the relevant option descriptions in your own words. Tell them which features are essential and which merely make presentation easier to read. For example, the report could still be useful without color, while the chronological order is part of its required behavior. Verifying those effects separately lets your colleague adapt an example without accidentally dropping the property the task needs.

Turn your lookup into a reliable step another learner can follow

Imagine you are writing the instruction that your own beginner self wishes they had seen. First specify where to run it and which inputs to prepare. Then write an exact, small example without a prompt prefix, fake shell output or unprocessed placeholders. Below the command, describe how to recognize a successful result and what a common failure means. If a later procedure changes real files, test the reasoning on a copy and establish the appropriate versioned backup and recovery process with the owner. Documentation should describe the verification step as clearly as it describes the action.

For the listing example, a complete note can say “In Bash on the tested practice system, place three reports of distinct modification times in the lab directory. Use the one-per-line option with time and reverse sorting. Expect the oldest file listed first. If the files have identical timestamps, prepare distinct sample times before using the ordering as evidence.” You can cite the local manual section and the command's actual path. This note is short and carries the essential conditions for someone else to reproduce it.

For the route example, say which pattern mode to use, where the input came from and how many known matches to expect. Mention that an empty printed result needs a status check when you need to distinguish no match from an error. Include the relevant version documentation. Read your note aloud and identify every word that hides a requirement. “Use grep” hides the difference between exact and pattern matching. “Sort the files” hides the choice of name, size or modification time. Explaining just those distinctions helps the reader choose the command with confidence.

Try one additional task without copying an answer from this page. Use the direct help on your installed tool to find the documented option for showing file sizes in a human-readable form where supported. Determine whether you need a long listing for the size to appear. Report what unit and rounding the option uses in your environment, then test it on a disposable example. A lab that proves one clear property is more useful than a page full of options you never observe. The skill is the sequence of identifying, documenting, testing and explaining.

Interview questions with worked answers

You know a command's name but one option fails. Which checks would you make?

I would record the exact command and error, ask the shell what name it resolved and identify the correct version. If it is a Bash built-in, use Bash help for it. For an external utility I would check its local manual or the project's documentation for that version. Then I would test the smallest example that can reproduce the behavior. This separates an unsupported option from a wrong path or syntax.

When would you use apropos rather than whatis?

I use apropos when I know the subject but want candidate manual entries. For example, a search for checksum can show which utilities are available in the index. Whatis answers what a known manual page name is described as doing. Both rely on indexed manual information. An empty result can indicate an omitted or stale index, so I would also try a direct lookup or other version-appropriate documentation.

Why might man 5 passwd and man 1 passwd show different pages?

The number selects a manual section for a different type of subject. Section five can describe the format of the account information file. Section one can describe a command used from a shell. Reading a format page helps explain columns in account data. Reading the command page helps me interpret its options and effects. I would first decide which problem I am answering.

Why does quoting a grep expression leave some characters with special meaning?

Quotes tell the shell how to pass the input to the program. Once grep receives it, the selected pattern mode decides how to interpret characters in it. Our sample period matched more than one input under regular expression syntax. Choosing fixed-string mode gave the intended literal substring. I would verify the result with two sample lines where the modes make different predictions.

Can a help page be present when the command you run comes from another version?

Yes. A manual search can locate documentation installed separately from an executable. A shell can find a different installation or use a function of the same name. I would compare the command resolution with the origin and version of the documentation, then run a harmless check using the intended tool. This matters when deciding whether a newer option can be used in a shared runbook.

Check your understanding

1. Your Bash shell reports that cd is a built-in. Which help source directly describes that built-in?

A. The local package history
B. help cd in Bash
C. A manual page for a similarly named file format

Answer and reasoning

B. Bash can describe its own built-ins. The type lookup shows which implementation to ask about.

2. You want to discover a command by task description. Which lookup fits?

A. An indexed manual keyword search
B. Printing the current directory alone
C. Typing the task as a program name

Answer and reasoning

A. The keyword can return multiple candidate pages. Check which description and section match your work.

3. A synopsis says FILE followed by three dots. What does that convention usually tell you?

A. Add three literal dots to each file name.
B. The command only accepts one unnamed file.
C. The file operand can be supplied more than once.

Answer and reasoning

C. Read the surrounding synopsis symbols for optional or required forms. Substitute the real paths when you run the command.

4. In the controlled log, fixed-string grep prints nothing and returns status one. What is the result?

A. The readable sample had no matching line.
B. The input was definitely missing.
C. The search rewrote the log.

Answer and reasoning

A. One is the no-selection status used in this example. An unreadable or missing input should give a different error.

5. What is the next step when a documented option is rejected by an installed executable?

A. Change system-wide permissions.
B. Confirm the implementation and look up the option for that version.
C. Accept every similar command from a different distribution.

Answer and reasoning

B. Match the reference to the actual program and environment. Then test the intended behavior with safe known inputs.

Revision cards

Identify the invocation

Ask the shell whether it resolved an alias, a function, a built-in or an executable. Choose help for that implementation.

Match names and sections

Manual sections distinguish commands from formats and interfaces. Choose the section that answers the question and verify its title.

Know the lookup question

Use a keyword search when you need candidate commands. Use a known page for syntax and behavior. Missing index entries are only one observation.

Read synopsis punctuation

Brackets, alternatives and repetition markers can describe syntax rather than literal input. Replace placeholders with the intended arguments.

Prove one thing in a fixture

Prepare a small known input with outputs that distinguish correct and wrong cases. Compare results before using the instruction elsewhere.

Interpret errors by stage

A shell lookup, an option parser and an input read can fail for different reasons. Record the first meaningful error, scope and tool version.

Official references