liveBook · Manning

Command-line interface

As explained in Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

A command-line shell is an interactive text-based interface that interprets and runs commands.

A command-line interface is a text-based way to interact with a computer or another machine. A shell accepts commands, runs command-line utilities, and displays results immediately. A terminal is the application that hosts the shell, so the two are related but distinct. section 1.0 section 2.0

PowerShell supports interactive command use before scripting. Type a command, add parameters, press Enter, and inspect the result. When a command becomes repetitive, save it in a .ps1 file and run it as a script. section 4.2

A practical command-line workflow is:

Inspect and refine processes

Start with Get-Process, then filter out PowerShell processes, sort by virtual memory, and select the first ten results. Each step can be tested immediately before adding the next. section 12.5

Get-Process | Where-Object { $_.Name -notlike 'pwsh*' } |
Sort-Object VM -Descending

Shows a runnable pipeline that filters processes and sorts them by virtual memory in descending order. section 12.5

How Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS covers it

How deep it goes
Defines shells and terminals, demonstrates iterative commands, and stops short of detailed scripting or programming internals.
Examples
Demonstrates PowerShell process inspection through filtering, sorting, selecting, and measuring pipeline results.
What it assumes
Assumes no scripting background and teaches shell, terminal, and interactive command distinctions from the beginning.
What you can do after
Apply it via PowerShell to run commands, inspect results, refine pipelines, and save repeated commands as scripts.
How it connects
Connects shells with terminals, command-line utilities, scripting languages, scripts, and pipelines.

Also explained in

Compare how 9 books explain command-line interface →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS. The section links point to the parts of the book it draws on.