Reference
CLI Command Cheat Sheet
A searchable rundown of shell commands you actually reach for —
git, grep, curl, ssh,
docker, find, awk,
sed, package managers, archive tools, the lot —
with canonical syntax, the flags you use 90% of the time, a couple of
examples, the gotcha that bites everyone, and per-row OS badges so
you know whether it runs on Linux, macOS, Windows, or in your Termux
shell.
How to use: pick a category tab or filter live by typing into the search box (matches across name, description, syntax, flags, and examples). Tap any abbreviated term in a cell to see what it stands for. The command column stays pinned as you scroll horizontally.
OS Compatibility Legend
Each row carries one or more badges showing where the command runs. Combine 🛡 root with the OS badges when the command requires elevated privileges.
- Linux
- macOS
- Windows
- Cross-platform
- Requires root / sudo
- Android (Termux)
Shell & CLI Glossary 17 terms
Click any term to see a beginner-friendly explanation. Cross-references inside an explanation open in a stacked modal — Escape closes them one at a time.
| Command | Description | Syntax | Flags / Options | Examples | Gotchas | See also | OS |
|---|---|---|---|---|---|---|---|
ls |
List directory contents. | ls [-l] [-a] [-h] [-S|-t] [-r] [<path>...] |
7
flags
|
|
macOS ships BSD |
cd, tree, stat
|
🐧🍎⚙️🤖
|
cd |
Change the current shell directory. | cd [<dir>|-|~] |
3
flags
|
|
|
pwd, pushd
|
⚙️
|
pwd |
Print the current working directory. | pwd [-L|-P] |
2 flags
|
|
— |
cd, realpath
|
⚙️
|
mkdir |
Create one or more directories. | mkdir [-p] [-m <mode>] <dir>... |
2 flags
|
|
— |
rmdir, chmod
|
🐧🍎⚙️🤖
|
rm |
Remove files and directories. | rm [-r] [-f] [-i] <file>... |
4
flags
|
|
|
mv, rmdir, trash
|
🐧🍎⚙️🤖
|
mv |
Move (rename) files and directories. | mv [-i] [-n] [-v] <src>... <dst> |
3
flags
|
|
— |
cp, rename, rm
|
🐧🍎⚙️🤖
|
cp |
Copy files and directories. | cp [-r] [-i] [-p] [-v] <src>... <dst> |
5
flags
|
|
BSD |
mv, rsync
|
🐧🍎⚙️🤖
|
touch |
Create empty files or update their access / modification time. | touch [-c] [-d <date>] [-r <ref>] <file>... |
3
flags
|
|
— |
stat, mkdir
|
🐧🍎⚙️🤖
|
ln |
Create hard or symbolic links. | ln [-s] [-f] <target> <link_name> |
3
flags
|
|
Hard links share the same inode and break if the file system runs out of inodes; you can’t hard-link across file systems or to directories. Symbolic links can point at anything but become broken if the target moves. |
readlink, realpath
|
🐧🍎⚙️🤖
|
stat |
Display detailed file metadata (inode, size, perms, timestamps). | stat [-c <fmt>|--format=<fmt>] <file>... |
2 flags
|
|
Format strings differ between GNU stat (Linux: |
ls, file
|
🐧🍎⚙️🤖
|
file |
Identify a file's type by its content (magic numbers), not its extension. | file [-b] [-i] <path>... |
2 flags
|
|
— |
stat
|
🐧🍎⚙️🤖
|
tree |
Show a directory hierarchy as an ASCII tree. | tree [-L <depth>] [-a] [-d] [-I <pattern>] [<path>] |
4
flags
|
|
Not installed by default on macOS ( |
ls, find
|
🐧🍎⚙️🤖
|
realpath |
Resolve a path to its absolute, symlink-free canonical form. | realpath [-e] [-s] <path> |
2 flags
|
|
Not available on stock macOS — install via |
readlink, pwd
|
🐧⚙️🤖
|
grep |
Search text for lines matching a pattern. | grep [-i] [-r] [-n] [-E|-F|-P] [-v] <pattern> [<file>...] |
11
flags
|
|
macOS ships BSD grep, which lacks |
awk, sed, find, ripgrep
|
🐧🍎⚙️🤖
|
find |
Walk a directory tree and act on files matching tests. | find <path>... [tests] [actions] |
8
flags
|
|
|
xargs, grep, fd
|
🐧🍎⚙️🤖
|
awk |
Pattern-action language for column-oriented text processing. | awk [-F <sep>] '<pattern> { <action> }' [<file>...] |
3
flags
|
|
|
sed, cut, grep
|
🐧🍎⚙️🤖
|
sed |
Stream editor — apply scripted edits to a stream of text. | sed [-i[<ext>]] [-E] '<script>' [<file>...] |
4
flags
|
|
|
awk, tr, grep
|
🐧🍎⚙️🤖
|
cut |
Extract specific bytes, characters, or fields from each line. | cut [-d <delim>] -f <fields> [<file>...] |
3
flags
|
|
— |
awk, paste
|
🐧🍎⚙️🤖
|
sort |
Sort lines of text. | sort [-n] [-r] [-u] [-k <field>] [-t <sep>] [<file>...] |
6
flags
|
|
— |
uniq, shuf
|
🐧🍎⚙️🤖
|
uniq |
Filter adjacent duplicate lines. | uniq [-c] [-d] [-u] [<file>] |
3
flags
|
|
|
sort
|
🐧🍎⚙️🤖
|
head |
Print the first N lines (or bytes) of a stream. | head [-n <count>|-c <bytes>] [<file>...] |
2 flags
|
|
— |
tail, less
|
🐧🍎⚙️🤖
|
tail |
Print the last N lines, optionally following a growing file. | tail [-n <count>] [-f] [<file>...] |
3
flags
|
|
— |
head, less
|
🐧🍎⚙️🤖
|
less |
Page through text interactively (forward and backward). | less [+<line>] [-N] [-S] [-R] [<file>] |
4
flags
|
|
Inside less: |
more, tail, head
|
🐧🍎⚙️🤖
|
cat |
Concatenate files and print to stdout. | cat [-n] [-A] [<file>...] |
2 flags
|
|
“Useless use of cat” — |
tac, head, tail
|
🐧🍎⚙️🤖
|
tee |
Read stdin, write to stdout AND to one or more files. | tee [-a] <file>... |
1 flag
|
|
The |
cat, xargs
|
🐧🍎⚙️🤖
|
xargs |
Build and execute commands from stdin. | xargs [-0] [-n <max>] [-I <repl>] [-P <jobs>] <cmd> |
4
flags
|
|
Without |
find, parallel
|
🐧🍎⚙️🤖
|
jq |
Filter, transform, and query JSON from the command line. | jq [-r] [-c] '<filter>' [<file>] |
4
flags
|
|
Not installed by default — |
awk, yq
|
🐧🍎⚙️🤖
|
wc |
Count lines, words, characters, or bytes. | wc [-l] [-w] [-c] [-m] [<file>...] |
4
flags
|
|
— |
awk
|
🐧🍎⚙️🤖
|
tr |
Translate or delete characters from stdin. | tr [-d] [-s] [-c] '<set1>' ['<set2>'] |
3
flags
|
|
— |
sed, awk
|
🐧🍎⚙️🤖
|
ps |
Snapshot the current process list. | ps [aux | -ef] [-o <fmt>] |
3
flags
|
|
|
top, pgrep, htop
|
🐧🍎⚙️🤖
|
top |
Live, sortable view of running processes. | top [-d <delay>] [-n <iters>] [-o <field>] [-u <user>] |
4
flags
|
|
Linux |
htop, ps, iotop
|
🐧🍎⚙️🤖
|
htop |
Interactive process viewer with colour, mouse support, and tree mode. | htop [-d <ds>] [-u <user>] [-p <pid>...] |
3
flags
|
|
Not installed by default — |
top, btop
|
🐧🍎⚙️🤖
|
kill |
Send a signal to one or more processes (default: SIGTERM). | kill [-<signal>|-l] <pid>... |
4
flags
|
|
Reach for |
pkill, killall, pgrep
|
🐧🍎⚙️🤖
|
pkill |
Kill processes by name pattern instead of PID. | pkill [-<signal>] [-f] [-u <user>] <pattern> |
3
flags
|
|
— |
kill, pgrep, killall
|
🐧🍎⚙️🤖
|
pgrep |
List PIDs of processes matching a name pattern. | pgrep [-f] [-u <user>] [-a] <pattern> |
3
flags
|
|
— |
pkill, ps
|
🐧🍎⚙️🤖
|
jobs |
List the current shell's background and stopped jobs. | jobs [-l] [-p] |
2 flags
|
|
Jobs are shell-local — they disappear when the shell exits unless you use |
bg, fg, nohup, disown
|
⚙️
|
nohup |
Run a command immune to hangups (so it survives shell exit). | nohup <cmd> [args...] [&] |
— |
|
Output goes to |
disown, tmux, screen
|
🐧🍎⚙️🤖
|
lsof |
List open files (including network sockets) and their owning processes. | lsof [-i [<host>:<port>]] [-p <pid>] [-u <user>] |
4
flags
|
|
Almost always needs |
ss, netstat, fuser
|
🐧🍎⚙️
|
time |
Run a command and report how long it took. | time <cmd> [args...] |
— |
|
|
hyperfine
|
⚙️
|
curl |
Transfer data to / from URLs (HTTP, HTTPS, FTP, SFTP, …). | curl [-X <method>] [-H "<header>"] [-d <data>] [-o <file>] [-L] [-sS] <url> |
11
flags
|
|
|
wget, httpie, rsync
|
⚙️
|
wget |
Non-interactive network downloader. | wget [-O <file>] [-c] [-r] [-N] <url> |
5
flags
|
|
Not installed on macOS by default — |
curl, aria2c
|
🐧⚙️🤖
|
ping |
Send ICMP echo requests to a host and report round-trip time. | ping [-c <count>] [-i <interval>] [-W <timeout>] <host> |
4
flags
|
|
Some networks block ICMP — “ping fails” doesn’t always mean the host is down. Sub-second |
traceroute, mtr
|
🐧🍎⚙️🤖
|
traceroute |
Show the network path (hop by hop) to a host. | traceroute [-n] [-T] [-w <s>] <host> |
4
flags
|
|
— |
mtr, ping
|
🐧🍎⚙️
|
mtr |
Combined traceroute + ping with a live rolling display. | mtr [-r] [-c <count>] [-w] <host> |
3
flags
|
|
— |
traceroute, ping
|
🐧🍎⚙️
|
dig |
Detailed DNS lookups (the canonical DNS debugger). | dig [@<server>] <name> [<type>] [+short] |
4
flags
|
|
— |
host, nslookup
|
🐧🍎⚙️
|
host |
Simpler DNS lookup utility — terse output by default. | host [-t <type>] <name> [<server>] |
2 flags
|
|
— |
dig, nslookup
|
🐧🍎⚙️
|
nslookup |
Older interactive DNS query tool (still useful on Windows). | nslookup <name> [<server>] |
— |
|
|
dig, host
|
🐧🍎🪟⚙️
|
ss |
Inspect sockets — listening ports, established connections, stats. | ss [-l] [-t] [-u] [-n] [-p] [-a] |
6
flags
|
|
|
netstat, lsof
|
🐧
|
netstat |
List network connections, routing tables, interface stats. | netstat [-l] [-t] [-u] [-n] [-p] [-r] |
5
flags
|
|
Deprecated on modern Linux in favour of |
ss, lsof, route
|
🐧🍎🪟⚙️
|
nmap |
Port scanner and network discovery tool. | nmap [-sS|-sT|-sU] [-p <ports>] [-A] [-Pn] <target> |
6
flags
|
|
Only scan networks you own or have written permission to scan. Aggressive scans are noisy and may trigger IDS alerts. |
ss, masscan
|
🐧🍎🪟⚙️🛡
|
ip |
Show / manipulate routing, devices, addresses, tunnels (modern Linux). | ip [<object>] [<command>] [<args>] |
4
flags
|
|
Replaced the older |
ifconfig, ss
|
🐧🛡
|
ifconfig |
Show / configure network interfaces (legacy Linux, default macOS). | ifconfig [<iface>] [up|down] |
— |
|
Deprecated on modern Linux (use |
ip
|
🐧🍎⚙️
|
ssh |
Open an authenticated, encrypted shell on a remote host. | ssh [-p <port>] [-i <key>] [-L|-R <fwd>] [<user>@]<host> [<cmd>] |
10
flags
|
|
Config goes in |
scp, rsync, ssh-keygen, ssh-copy-id
|
⚙️
|
scp |
Copy files over SSH. | scp [-r] [-P <port>] [-i <key>] <src>... [<user>@]<host>:<dst> |
5
flags
|
|
OpenSSH 9+ switched |
rsync, sftp, ssh
|
⚙️
|
rsync |
Fast incremental file sync (local or over SSH) with delta transfer. | rsync [-a] [-v] [--delete] [-z] [-P] <src>/ <dst>/ |
8
flags
|
|
Trailing |
scp, tar, cp
|
⚙️
|
ssh-keygen |
Generate, inspect, and manage SSH keypairs. | ssh-keygen [-t <algo>] [-b <bits>] [-f <path>] [-C <comment>] |
7
flags
|
|
Default output path is |
ssh, ssh-copy-id, ssh-add
|
⚙️
|
ssh-copy-id |
Install your public key into a remote user's authorized_keys. | ssh-copy-id [-i <pubkey>] [-p <port>] [<user>@]<host> |
3
flags
|
|
Not bundled with Windows OpenSSH — workaround: |
ssh, ssh-keygen
|
🐧🍎⚙️
|
sftp |
Interactive file transfer over SSH (FTP-like commands). | sftp [-P <port>] [-i <key>] [<user>@]<host> |
— |
|
Once connected: |
scp, rsync, sshfs
|
⚙️
|
mosh |
Mobile shell — SSH-like but survives roaming, sleep, and packet loss. | mosh [<user>@]<host> |
— |
|
Uses UDP on ports 60000–61000 — open those if your network blocks them. Needs |
ssh, tmux
|
🐧🍎⚙️🤖
|
git clone |
Copy a remote repository to your machine. | git clone [--depth <n>] [-b <branch>] <url> [<dir>] |
4
flags
|
|
— |
git init, git remote
|
⚙️
|
git status |
Show working-tree and staging-area changes. | git status [-s] [-b] [--untracked-files=<mode>] |
3
flags
|
|
— |
git diff, git log
|
⚙️
|
git add |
Stage changes for the next commit. | git add [-A|-u|-p] [<pathspec>...] |
4
flags
|
|
|
git restore, git reset, git commit
|
⚙️
|
git commit |
Record staged changes as a new commit. | git commit [-m "<msg>"] [-a] [--amend] [--no-edit] |
5
flags
|
|
Never |
git add, git push, git reset, git log
|
⚙️
|
git push |
Upload local commits to a remote branch. | git push [-u] [--force-with-lease] [<remote>] [<branch>] |
5
flags
|
|
Default |
git pull, git fetch
|
⚙️
|
git pull |
Fetch from remote and merge / rebase into the current branch. | git pull [--rebase] [--ff-only] [<remote>] [<branch>] |
3
flags
|
|
Set |
git fetch, git merge, git rebase
|
⚙️
|
git fetch |
Download remote commits without merging. | git fetch [--all] [--prune] [<remote>] [<refspec>] |
3
flags
|
|
— |
git pull, git remote
|
⚙️
|
git switch |
Change branches (the modern replacement for `git checkout` for branches). | git switch [-c|-C] [-t <upstream>] <branch> |
4
flags
|
|
— |
git restore, git checkout, git branch
|
⚙️
|
git restore |
Restore files in working tree or staging area (replaces `git checkout -- file`). | git restore [--staged] [--source=<commit>] <pathspec>... |
3
flags
|
|
— |
git switch, git reset, git checkout
|
⚙️
|
git branch |
List, create, delete, or rename branches. | git branch [-a] [-d|-D <name>] [-m <new>] [<name> [<base>]] |
5
flags
|
|
— |
git switch, git merge
|
⚙️
|
git merge |
Merge another branch into the current one. | git merge [--no-ff] [--squash] [--abort] <branch> |
4
flags
|
|
— |
git rebase, git pull
|
⚙️
|
git rebase |
Replay commits onto a different base — rewrites history. | git rebase [-i] [--onto <newbase>] [--continue|--abort] <upstream> |
5
flags
|
|
Never rebase commits that have been pushed to a shared branch. Rebasing rewrites SHAs, so anyone with the old SHAs will be on a diverged history. |
git merge, git cherry-pick
|
⚙️
|
git stash |
Temporarily shelve working-tree changes. | git stash [push -m "<msg>"|pop|list|drop|apply] |
6
flags
|
|
Stashes are local-only — they never push or sync. Don’t treat the stash as long-term storage; commit to a wip branch if you’ll be gone for more than a day. |
git commit, git restore
|
⚙️
|
git log |
Show commit history. | git log [--oneline] [--graph] [-<n>] [--author=<who>] [<path>...] |
7
flags
|
|
— |
git show, git diff, git blame
|
⚙️
|
git diff |
Show changes between commits, branches, working tree, or staging. | git diff [--staged] [<commit>[..<commit>]] [-- <path>...] |
4
flags
|
|
— |
git log, git show
|
⚙️
|
git reset |
Move HEAD (and optionally the index / working tree) to a different commit. | git reset [--soft|--mixed|--hard] [<commit>] |
3
flags
|
|
|
git restore, git revert, git reflog
|
⚙️
|
git remote |
Manage the set of configured remote repositories. | git remote [-v | add <name> <url> | set-url <name> <url> | remove <name>] |
4
flags
|
|
— |
git fetch, git push
|
⚙️
|
git tag |
Create, list, or delete lightweight / annotated tags. | git tag [-a <name> -m "<msg>"] [-d <name>] [-l <glob>] |
4
flags
|
|
— |
git push, git describe
|
⚙️
|
apt |
Debian/Ubuntu package manager (newer wrapper around apt-get/apt-cache). | apt [update|upgrade|install|remove|search|show] [<pkg>...] |
7
flags
|
|
Always run |
apt-get, dpkg
|
🐧🛡🤖
|
brew |
Homebrew package manager for macOS (and Linux via Linuxbrew). | brew [install|uninstall|upgrade|search|info|services] [<pkg>...] |
6
flags
|
|
Don’t |
port, apt
|
🍎🐧⚙️
|
pacman |
Arch Linux package manager. | pacman [-S|-R|-Q|-Sy|-Syu|-Ss] [<pkg>...] |
7
flags
|
|
Never run |
yay, paru, dnf
|
🐧🛡
|
pip |
Install Python packages from PyPI (or sources). | pip [install|uninstall|list|show|freeze] [<pkg>...] |
7
flags
|
|
Don’t |
pipx, uv, poetry
|
⚙️
|
npm |
Node.js package manager. | npm [install|uninstall|update|run|publish|init] [<pkg>...] |
8
flags
|
|
Use |
npx, pnpm, yarn
|
⚙️
|
npx |
Run a one-off npm package binary without installing it globally. | npx [-y] <package>[@version] [args...] |
3
flags
|
|
— |
npm
|
⚙️
|
cargo |
Rust package manager and build tool. | cargo [new|build|run|test|add|publish] [<args>...] |
6
flags
|
|
— |
rustup
|
⚙️
|
bundle |
Ruby's Bundler — manage gem dependencies per project. | bundle [install|update|exec|add] [<gem>...] |
4
flags
|
|
— |
gem
|
⚙️
|
tar |
Tape archiver — bundle (and optionally compress) directories. | tar [c|x|t] [v] [z|j|J] [-f <archive>] [<files>...] |
10
flags
|
|
Argument order matters with single-letter flags — |
gzip, xz, zip
|
🐧🍎⚙️🤖
|
zip |
Create a ZIP archive (cross-platform). | zip [-r] [-9] [-e] <archive>.zip <files>... |
4
flags
|
|
— |
unzip, tar, 7z
|
🐧🍎🪟⚙️🤖
|
unzip |
Extract files from a ZIP archive. | unzip [-l] [-o] [-d <dir>] <archive>.zip [<files>...] |
4
flags
|
|
— |
zip, tar, 7z
|
🐧🍎🪟⚙️🤖
|
gzip |
Single-file gzip compression (.gz). | gzip [-d] [-k] [-<level>] <file>... |
4
flags
|
|
|
tar, xz, bzip2
|
🐧🍎⚙️🤖
|
7z |
7-Zip — high-ratio compression, supports many archive formats. | 7z [a|x|l] [-p<pwd>] <archive>.7z [<files>...] |
6
flags
|
|
— |
zip, tar
|
🐧🍎🪟⚙️
|
xz |
LZMA2 compression — small archives at the cost of CPU time. | xz [-d] [-k] [-<level>] <file> |
4
flags
|
|
— |
gzip, zstd, tar
|
🐧🍎⚙️
|
sudo |
Run a single command as another user (default: root). | sudo [-i|-u <user>|-E|-k] <cmd> [args...] |
6
flags
|
|
|
su, doas, visudo
|
🐧🍎⚙️🛡🤖
|
chmod |
Change file permissions. | chmod [<mode>|<symbolic>] <file>... |
5
flags
|
|
Octal cheat sheet: |
chown, umask, stat
|
🐧🍎⚙️🤖
|
chown |
Change file owner and / or group. | chown [-R] [<user>][:<group>] <file>... |
5
flags
|
|
— |
chmod, chgrp
|
🐧🍎⚙️🛡
|
umask |
Show or set the default permission mask for new files. | umask [<octal>] |
— |
|
Umask is subtracted from the default base mode (666 for files, 777 for dirs). |
chmod
|
⚙️
|
df |
Report filesystem disk space usage. | df [-h] [-T] [-i] [<path>] |
4
flags
|
|
“No space left on device” can mean blocks OR inodes — check |
du, lsblk
|
🐧🍎⚙️🤖
|
du |
Estimate file space usage (per directory). | du [-h] [-s] [-d <depth>] [<path>...] |
5
flags
|
|
|
df, ncdu
|
🐧🍎⚙️🤖
|
mount |
Mount a filesystem at a directory. | mount [-t <type>] [-o <opts>] <device> <mountpoint> |
3
flags
|
|
— |
umount, lsblk, fstab
|
🐧🍎⚙️🛡
|
umount |
Unmount a filesystem. | umount [-l] [-f] <mountpoint|device> |
2 flags
|
|
“Target is busy” usually means a shell is |
mount, fuser, lsof
|
🐧🍎⚙️🛡
|
lsblk |
List block devices in a tree (disks → partitions → mappings). | lsblk [-f] [-p] [-o <cols>] |
3
flags
|
|
— |
df, blkid, fdisk
|
🐧
|
free |
Show memory usage (RAM and swap). | free [-h] [-s <sec>] [-c <count>] |
3
flags
|
|
|
top, vmstat
|
🐧
|
uname |
Print system / kernel info. | uname [-a|-r|-s|-m] |
4
flags
|
|
— |
lsb_release, hostnamectl
|
🐧🍎⚙️🤖
|
id |
Print the calling user's UID, GID, and group memberships. | id [-u|-g|-G|-n] [<user>] |
4
flags
|
|
— |
whoami, groups
|
🐧🍎⚙️🤖
|
echo |
Print arguments to stdout. | echo [-n] [-e] <string>... |
2 flags
|
|
|
printf
|
⚙️
|
printf |
Format and print — like C's printf. | printf <format> [<arg>...] |
— |
|
— |
echo
|
⚙️
|
export |
Mark a shell variable as exported to child processes. | export [<name>=<value>] [<name>...] |
— |
|
An assignment without |
env, unset
|
⚙️
|
env |
Print the environment, or run a command with a modified one. | env [-i] [<name>=<value>...] [<cmd> [args...]] |
2 flags
|
|
The shebang line |
export, printenv
|
⚙️
|
alias |
Create a shorthand for a longer command. | alias [<name>='<replacement>'] |
— |
|
Aliases are shell-local — define them in |
unalias, function
|
⚙️
|
history |
Show or manipulate the command history. | history [-c] [-d <offset>] [<count>] |
3
flags
|
|
Bash truncates history to |
alias
|
⚙️
|
which |
Show the full path to a command (or that it's an alias / builtin). | which [-a] <name> |
1 flag
|
|
|
type, whereis, command
|
🐧🍎⚙️🤖
|
type |
Tell you what a name is — alias, builtin, function, or external binary. | type [-a] [-t] <name>... |
2 flags
|
|
— |
which, command
|
⚙️
|
man |
Show the manual page for a command, syscall, or function. | man [<section>] <name> |
3
flags
|
|
Inside man: |
apropos, whatis, tldr
|
🐧🍎⚙️🤖
|
read |
Read one line from stdin into shell variables. | read [-p <prompt>] [-s] [-r] [-t <sec>] [-a <arr>] <var>... |
5
flags
|
|
Always use |
readarray, mapfile
|
⚙️
|
Redirection idioms |
Plumb stdin / stdout / stderr to files, pipes, and each other. | cmd [> file] [>> file] [< file] [2> file] [2>&1] [<<EOF...EOF] [<(cmd)] |
10
flags
|
|
Order matters: |
tee, xargs
|
⚙️
|
python3 |
Run Python — REPL, scripts, modules, one-liners. | python3 [-i] [-c "<code>"] [-m <module>] [<script> [args]] |
5
flags
|
|
System Python and your project’s Python are different — use |
pip, pipx, uv, pyenv
|
⚙️
|
node |
Run JavaScript with Node.js — REPL, scripts, one-liners. | node [-e "<code>"] [-p "<expr>"] [<script> [args]] |
5
flags
|
|
— |
npm, npx, deno, bun
|
⚙️
|
ruby |
Run Ruby — REPL via irb, scripts, one-liners. | ruby [-e "<code>"] [-n|-p] [-l] [<script> [args]] |
5
flags
|
|
— |
irb, gem, bundle
|
⚙️
|
irb |
Interactive Ruby REPL. | irb [-r <lib>] [--simple-prompt] |
2 flags
|
|
— |
ruby, pry
|
⚙️
|
bash |
GNU Bash shell — interactive or batch. | bash [-c "<cmd>"] [-i] [-l] [<script> [args]] |
7
flags
|
|
The “strict mode” trio |
zsh, sh, dash
|
🐧🍎⚙️🤖
|
zsh |
Z shell — bash-compatible-ish with extras (globbing, prompts, plugins). | zsh [-c "<cmd>"] [-i] [<script> [args]] |
— |
|
Default shell on macOS since Catalina. Most bash scripts work unchanged but a few subtle differences exist (word splitting on unquoted vars, glob behaviour). Pin scripts to bash with |
bash, oh-my-zsh
|
🐧🍎⚙️🤖
|
Shebang lines |
The #! interpreter directive at the top of a script. | #!<path-to-interpreter> [<flags>] |
— |
|
Use |
bash, python3, node
|
🐧🍎⚙️🤖
|
docker run |
Create and start a container from an image. | docker run [-d] [-it] [--rm] [-p <h>:<c>] [-v <h>:<c>] [-e <k>=<v>] <image> [<cmd>] |
10
flags
|
|
Default users inside containers are often |
docker exec, docker ps, docker stop
|
⚙️
|
docker ps |
List containers. | docker ps [-a] [--filter <f>] [--format <fmt>] |
4
flags
|
|
— |
docker rm, docker stop
|
⚙️
|
docker build |
Build an image from a Dockerfile. | docker build [-t <tag>] [-f <Dockerfile>] [--build-arg <k>=<v>] [--target <stage>] <context> |
6
flags
|
|
The context ( |
docker buildx, docker push
|
⚙️
|
docker exec |
Run a command inside an already-running container. | docker exec [-it] [-u <user>] <container> <cmd> [args...] |
4
flags
|
|
— |
docker run, docker logs
|
⚙️
|
docker logs |
Show stdout / stderr of a container. | docker logs [-f] [--tail <n>] [--since <t>] <container> |
4
flags
|
|
— |
docker ps, docker exec
|
⚙️
|
docker compose |
Define and run multi-container applications via a YAML file. | docker compose [-f <file>] [up|down|ps|logs|exec] [args...] |
8
flags
|
|
|
docker run, docker build
|
⚙️
|
podman |
Daemonless, root-less Docker-compatible container engine. | podman <command> [args...] |
— |
|
CLI is a near-superset of Docker’s (most |
docker run, docker build
|
🐧🍎⚙️
|
kubectl |
Talk to a Kubernetes cluster — inspect, deploy, exec, log. | kubectl [-n <ns>] [get|describe|logs|exec|apply|delete|edit] <resource> [args...] |
5
flags
|
|
Always confirm |
kubectx, helm, k9s
|
⚙️
|
No commands match your filters.