Command-Line Tools and Processes

  1. Shell Commands and Program Arguments

    A shell interprets a command line and starts a program with an argument list. The program receives the resulting values.

    Undergraduate
  2. Single and Double Quoting in a POSIX Shell

    Quoting controls how the shell interprets characters before constructing an argument. Different quoting forms permit different expansions.

    Undergraduate
  3. Options and Operands in a Command

    Options commonly choose behavior or set values, while operands supply objects such as input paths. An interface must document the actual syntax it accepts.

    Undergraduate
  4. The Working Directory of a Shell Command

    A relative path is generally resolved from the process's current working directory. Commands started by a shell normally inherit that directory unless their launcher changes it.

    Undergraduate
  5. Shell Variables and the Process Environment

    A shell can hold local variables. An exported variable can be passed to commands the shell starts, as specified by the shell.

    Undergraduate
  6. Connecting Commands with a Pipe

    A pipe can connect one process's ordinary output to another process's input. Each end sees a stream under its own interface.

    Undergraduate
  7. Redirecting Command Streams to Files

    Redirection associates an input or output stream with a selected file or other endpoint. It can change what is visible to the terminal.

    Undergraduate
  8. Appending to or Replacing Command Output

    A redirection can append output after existing bytes or open an ordinary file for replacement, depending on the specified operator and shell.

    Undergraduate
  9. Keeping Command Output Machine-Readable

    A command used in a pipeline should keep its data stream in the declared format, with unrelated progress and diagnostics directed separately.

    Undergraduate
  10. Reading Exit Status Across Several Commands

    A pipeline includes the outcomes of separate commands. The shell's reported pipeline status depends on its rules and settings.

    Undergraduate
  11. Waiting for a Child Process to Finish

    A parent can wait for a child process to finish and collect a result describing how it exited.

    Undergraduate
  12. Giving a Child Process a Time Budget

    A launcher can limit how long it waits for work. Its cancellation and cleanup behavior needs a separate contract.

    Undergraduate
  13. Foreground and Background Work in a Shell

    A foreground command normally occupies the shell's active job context until completion. Background work can run while the shell accepts more commands.

    Undergraduate
  14. Signals and Process Shutdown

    A process can receive operating-system notifications used for control. Available signals and handling rules depend on the platform.

    Undergraduate
  15. Launching a Program with a Structured Argument List

    A process launcher can often receive an executable and separate argument values directly. This avoids depending on shell interpretation for ordinary paths and settings.

    Undergraduate
  16. Line-Oriented Command Pipelines

    A line-oriented pipeline can filter or summarize rows as long as its tools agree on what a line and record mean.

    Undergraduate
  17. Filename Globs and Text Patterns

    A shell glob commonly expands to matching pathnames before a command runs. A text pattern supplied to a program may be interpreted by the program instead.

    Undergraduate
  18. Locale and Ordering in Command-Line Workflows

    A locale can influence collation, message text, or textual representations. Record it when those properties affect a result.

    Undergraduate
  19. Finding an Executable through the Search Path

    A shell can search an ordered list of directories to resolve an executable name. A different environment can select a different program with the same name.

    Undergraduate
  20. Selecting the Interpreter for a Script

    A script may be run by passing its path to an interpreter or by an operating-system mechanism that selects an interpreter on launch.

    Undergraduate
  21. Quiet and Verbose Command Output

    A command can provide different levels of diagnostic detail while preserving its documented data output and success signal.

    Undergraduate
  22. Reading a Command's Help and Examples

    A help display can identify accepted argument forms, defaults, and platform options. Concrete tests reveal behavior at ambiguous boundaries.

    Undergraduate
  23. Supplying Command Input from a Test Runner

    A test can launch a real command with controlled input bytes, working directory, environment, and arguments.

    Undergraduate
  24. Collecting Both Outputs from a Child Process

    When both output streams are piped, a parent must consume them in a way that allows the child to keep writing and finish.

    Undergraduate
  25. Terminal and Captured Output Behavior

    A command may detect whether it writes to a terminal and choose progress formatting or buffering that would be awkward in a data file.

    Undergraduate
  26. Changes in a Shell and in Its Child Processes

    A child normally receives an inherited environment and starting directory. Changing those settings in the child does not normally change the parent's environment.

    Undergraduate
  27. Testing a Command with Synthetic Files

    Synthetic fixtures let a test exercise format boundaries and error reporting without using real personal or production data.

    Undergraduate
  28. Recording the Arguments of a Reproducible Command

    A display of a command line should preserve argument boundaries or describe the original argument array directly.

    Undergraduate
  29. Documenting What Command Exit Codes Mean

    An application can give meaning to success and failure statuses that callers use to control a workflow.

    Undergraduate
  30. Designing a Command for Other Programs to Use

    A reusable command states how it reads data, what its success output contains, and how failures reach a caller.

    Undergraduate