Terminals & Shells Cheat Sheets
Shells, terminal apps, package managers and editors that run in a terminal.
apt & dpkg (Debian/Ubuntu)
apt installs packages from repositories and handles dependencies. dpkg works with individual .deb files. Most commands need sudo.
Bash (Debian / Linux)
The standard Linux shell. Use man command or command --help for details on any command.
dnf / pacman / zypper
Package managers for the other big Linux families: dnf (Fedora, RHEL, Rocky, Alma), pacman (Arch, Manjaro, EndeavourOS), zypper (openSUSE). All need sudo for changes. For Debian/Ubuntu see the apt sheet.
Git Bash
A Bash shell for Windows, installed with Git for Windows. You get Linux commands (ls, grep, ssh…) on your Windows files. For Git commands, see the Git cheat sheet.
macOS Terminal / iTerm2
The default macOS shell is zsh (config in ~/.zshrc). Most Linux commands work too; see the Bash sheet. This page covers the Mac-specific parts.
Nano
A simple terminal text editor. You can type straight away. In the help bar, ^ means Ctrl and M- means Alt (or Esc).
PowerShell
PowerShell pipes objects between commands, not text. Commands follow a Verb-Noun pattern. Works on Windows PowerShell 5.1 and PowerShell 7+ (pwsh).
SSH & SCP
Log in to remote machines securely and copy files between them. Works the same on Linux, macOS, Git Bash, WSL and Windows 10+ (OpenSSH is built in).
tmux
A terminal multiplexer: split panes, several windows, and sessions that keep running after you disconnect (great over SSH). Every shortcut starts with the prefix Ctrl + b, then the key. Written below as prefix + key.
Vim / Neovim
A modal editor. Normal mode is for moving and commands, Insert mode is for typing, Visual mode is for selecting. When in doubt, press Esc. To learn, run vimtutor (Vim) or :Tutor (Neovim).
Windows Command Prompt
The classic Windows shell. Commands are not case-sensitive. Add /? to any command for help (for example dir /?).
Windows Terminal
One app for PowerShell, cmd, WSL, Git Bash and SSH with tabs and split panes. These are the default keybindings; change them under Settings → Actions.
WSL
Run a real Linux distro inside Windows. Run these commands from PowerShell or cmd. Inside the distro, use the Bash and apt sheets.