All shell commands
227 commands grouped by category. Each page shows the canonical answer in bash, zsh, fish, PowerShell, and cmd.exe — with worked examples, gotchas, and WSL / PowerShell Core notes where it matters.
Files (48)
- add-content
PowerShell's append-to-file cmdlet — the equivalent of bash `>>` redirection that adds content to the end of an existing file.
- basename
Strip the directory part of a path, leaving only the final filename component.
- cat
Print file contents to standard output.
- command-v
POSIX way to test whether a command exists and where it resolves.
- copy-item
PowerShell's copy cmdlet — the cp equivalent.
- cp
Copy files and directories.
- dd
Copy and convert files at the block level — used for disk imaging, raw I/O, and filling test files.
- df
Report mounted-filesystem free space and inode usage.
- dirname
Strip the final filename component from a path, leaving only the directory part.
- du
Summarize disk usage of files and directories.
- file
Identify a file by its magic bytes, not its extension.
- find
Locate files by name, size, time, or other attributes.
- get-childitem
PowerShell's directory-listing cmdlet — the ls equivalent.
- get-command
PowerShell's command-introspection cmdlet — the which / type / command -v equivalent that returns rich CommandInfo objects.
- get-content
PowerShell's file-read cmdlet — the cat / tail equivalent.
- get-location
PowerShell's current-directory cmdlet — the pwd equivalent that returns a structured PathInfo object.
- less
Page through a file with backward navigation and search.
- ln
Create a hard link or symbolic link to a file or directory.
- ls
List directory contents.
- lsblk
List block devices (disks, partitions, LVM volumes, RAID arrays) as a tree showing size, mountpoint, and filesystem.
- md5sum
Print an MD5 hash of one or more files. Cryptographically broken — integrity-only.
- mkdir
Create a new directory.
- mktemp
Create a uniquely-named temporary file (or directory) in a race-free way.
- more
View a file one screen at a time (basic pager).
- mount
Attach a filesystem (disk, image, network share) to a directory in the tree so its contents become accessible.
- move-item
PowerShell's move/rename cmdlet — the mv equivalent.
- mv
Move or rename files and directories.
- new-item
PowerShell's create-file/directory cmdlet — like touch + mkdir.
- out-file
PowerShell's pipeline-to-file cmdlet — the equivalent of bash `>` redirection that writes formatted text output to a file.
- readlink
Print the target of a symbolic link, or the canonical path.
- realpath
Resolve a path to its absolute, canonical form.
- remove-item
PowerShell's delete cmdlet — the rm / rmdir / del equivalent.
- resolve-path
PowerShell's path-canonicalize cmdlet — the realpath equivalent.
- rm
Delete files and directories.
- set-content
PowerShell's verbatim file-writer cmdlet — the equivalent of bash `>` that overwrites a file with raw, unformatted content.
- set-location
PowerShell's working-directory cmdlet — the cd equivalent that also navigates registry and other PowerShell providers.
- sha1sum
Print a SHA-1 hash of one or more files. Cryptographically broken — integrity-only.
- sha256sum
Print a SHA-256 hash of one or more files.
- sha512sum
Print a SHA-512 hash of one or more files — 128 hex chars, current best-practice for high-stakes integrity.
- shasum
BSD/macOS Perl wrapper that computes SHA-1 through SHA-512 hashes of files.
- stat
Print a file's size, mode, owner, and timestamps.
- test-path
PowerShell's path-existence cmdlet — the bash [ -e ] equivalent.
- touch
Create an empty file or update its modification time if it exists.
- tree
Print a directory tree showing files and subdirectories.
- type
Show how a name is interpreted — builtin, function, alias, or file.
- umount
Detach a previously mounted filesystem from its directory in the tree, flushing pending writes first.
- whereis
Locate the binary, source, and manual page for a command.
- which
Locate an executable in PATH and print its full path.
Text (46)
- awk
Pattern scanning and processing language for structured text.
- bc
Arbitrary-precision command-line calculator that evaluates an expression and prints the result.
- cmp
Byte-by-byte comparison of two files — the binary counterpart to diff.
- column
Format whitespace- or delimiter-separated input into aligned columns.
- comm
Compare two SORTED files line by line, emitting three columns: only-in-file1, only-in-file2, in-both.
- compare-object
PowerShell's set-difference cmdlet — the diff equivalent for comparing two collections of objects or text.
- convertfrom-json
Parse a JSON string into PowerShell objects you can pipe and filter.
- convertto-json
Serialise a PowerShell object graph to a JSON string.
- cut
Extract sections (fields or characters) from each line.
- diff
Compare two files or directories line-by-line and report the differences.
- echo
Print arguments to standard output, separated by spaces, followed by a newline.
- export-csv
Write PowerShell objects to a CSV file with a header row.
- grep
Search file contents for a pattern.
- group-object
PowerShell's grouping cmdlet — the `sort | uniq -c` equivalent that buckets items by a property and returns counts plus the underlying groups.
- head
Output the first lines of a file.
- hexdump
BSD-style hexadecimal dump — flexible format strings for byte-level inspection.
- iconv
Convert text between character encodings (UTF-8, UTF-16, Latin-1, GBK, …) with optional transliteration.
- import-csv
Read a CSV file into PowerShell objects, inferring property names from the header row.
- jq
Command-line JSON processor — filter, transform, and build JSON from the shell.
- measure-object
PowerShell's aggregation cmdlet — counts items and computes sum/min/max/average, similar to wc plus awk arithmetic.
- nl
Number the lines of a file (or stdin), emitting line numbers followed by each line.
- od
Dump file contents in octal, hexadecimal, decimal, or character form — for binary inspection.
- paste
Merge corresponding lines of two or more files side-by-side, tab-separated by default.
- patch
Apply a unified diff to source files, transforming them in place.
- sed
Stream editor for filtering and transforming text.
- select-object
PowerShell's projection cmdlet — picks specific properties or the first/last N objects, like cut + head + tail combined.
- select-string
PowerShell's pattern-search cmdlet — the grep equivalent.
- seq
Generate an arithmetic sequence of numbers (1, 2, 3, … N) — one per line by default.
- sort
Sort lines of text.
- sort-object
PowerShell's sort cmdlet — sorts pipeline objects by one or more properties.
- split
Split a large file into smaller chunks by line count, byte size, or chunk count.
- strings
Extract printable ASCII (and optionally UTF-16) sequences from binary files.
- tac
Concatenate and print files in reverse line order.
- tail
Output the last lines of a file.
- tee
Read stdin and write to both stdout and one or more files at once.
- tr
Translate or delete characters from input.
- uniq
Filter adjacent duplicate lines.
- wc
Count lines, words, or bytes.
- where-object
PowerShell's pipeline filter cmdlet — the awk/grep equivalent for filtering objects by property.
- write-host
PowerShell's host-UI writer — the coloured-banner echo that bypasses the pipeline and prints directly to the terminal.
- write-output
PowerShell's pipeline-emitter cmdlet — the echo equivalent that sends objects, not just text, down the pipeline.
- xargs
Build and execute command lines from standard input.
- xmllint
Parse, validate, and query XML documents on the command line — from the libxml2 project. XPath queries, DTD/XSD validation, pretty-printing, and XInclude resolution.
- xxd
Hexadecimal dump utility — show file contents as hex bytes plus ASCII gutter.
- yes
Emit a string (default "y") repeatedly until killed — used to auto-confirm interactive prompts.
- yq
Query, transform, and edit YAML, JSON, TOML, and XML on the command line — the jq-shaped tool for non-JSON config formats. TWO competing implementations: mikefarah/yq (Go, jq-syntax-compatible) and kislyuk/yq (Python, jq-wrapper).
Shell (57)
- alias
Create a shortcut name for a longer command line.
- apt
Install, upgrade, and remove packages on Debian / Ubuntu / Mint via the APT package manager — the canonical "install software" command for Debian-family Linux.
- bang-bang
History expansion `!!` — repeat the previous command.
- bang-dollar
History expansion `!$` — last argument of the previous command.
- break
Exit the innermost (or N-th enclosing) loop.
- brew
Install, upgrade, and remove packages on macOS (and Linux) via Homebrew — the de-facto macOS package manager, also installable as Linuxbrew on Debian / RHEL.
- clear-host
PowerShell's terminal-clearing cmdlet — the clear / cls equivalent that wipes the visible scrollback.
- continue
Skip to the next iteration of the innermost (or N-th enclosing) loop.
- date
Print the current date and time, or format an arbitrary date — the surface you reach for to timestamp logs, name backup files, or compute "now minus N days".
- declare
Declare a variable, an array, or set variable attributes.
- dialog
Generate ncurses-style TUI widgets (menus, prompts, checkboxes, gauges, password fields) from shell scripts — capture user input as exit-code + stderr text.
- double-bracket
[[ ]] extended test in bash/zsh with regex and patterns.
- env
Print the current environment variables — every `NAME=value` pair exported into the running process, plus the gateway for running a command with a modified environment.
- eval
Parse and execute a string as if it were a shell command.
- exec
Replace the current shell with another program.
- exit
Terminate the current shell or script with an optional exit status.
- expect
Automate interactive command-line programs — Tcl-based scripting tool that "expects" patterns in a program's output and "sends" responses, like a programmable user.
- export
Set an environment variable and mark it for export to child processes.
- expr
Evaluate an expression (POSIX arithmetic / string ops).
- fc
Edit and re-run the previous command in $EDITOR.
- foreach-object
PowerShell's pipeline-loop cmdlet — the xargs / while-read equivalent for running a block per object.
- function
Define a reusable named function in a shell script.
- get-date
PowerShell's current-time and date-arithmetic cmdlet.
- get-help
PowerShell's documentation cmdlet — the man / info equivalent that pulls help text for cmdlets, functions, and conceptual topics.
- get-member
PowerShell object introspection — list properties, methods, and events on an object.
- getopts
Parse short option flags inside a shell script.
- gpg
OpenPGP encryption, signing, and key management — GnuPG.
- groups
List the groups a user belongs to — controlling which files, devices, and capabilities the user can access via group permissions.
- history
Show previously run commands from the shell history.
- id
Print the current user's UID, GID, and group memberships.
- invoke-expression
PowerShell's runtime string-evaluator cmdlet — the `eval` equivalent that parses and executes a string as code. Powerful and dangerous.
- let
Bash/zsh arithmetic-evaluation builtin — assign integer expressions to variables.
- man
Display the manual page for a command — the canonical authoritative documentation that ships with the binary, before tutorials or Stack Overflow answers.
- passwd
Change a user account password — set, expire, lock, or unlock.
- pip
Install, upgrade, and remove Python packages from PyPI — Python's standard package manager, identical CLI across Linux, macOS, and Windows.
- printenv
Print the value of a specific environment variable (or all of them) — `env` without the subprocess-launching machinery, optimised for scripts that just want to read.
- printf
Print formatted text using C-style format specifiers like %s and %d.
- read
Read a line of input into one or more shell variables interactively.
- read-host
PowerShell interactive prompt — read a string (or SecureString) from the user.
- return
Exit a shell function with a numeric status code.
- rpm
Install, query, verify, and uninstall individual `.rpm` package files on RHEL / CentOS / Fedora / SUSE — the low-level package backend underneath yum/dnf/zypper.
- set
Toggle shell options like errexit/xtrace and set positional parameters.
- sleep
Pause execution for a number of seconds.
- source
Load a script into the current shell so its definitions persist.
- test
Evaluate a conditional — file tests, string and number comparisons.
- time
Measure how long a command takes to run.
- times
Show accumulated CPU time used by the shell and its children.
- tmux
Terminal multiplexer — keep multiple shell sessions alive in one terminal, detach and reattach across SSH disconnects, and split panes for side-by-side work.
- trap
Run a handler when the shell receives a signal or exits.
- typeset
Declare a variable or set its attributes (zsh canonical name).
- ulimit
Read or set the shell process's resource limits (open files, stack, memory, …).
- unalias
Remove an alias previously defined with alias.
- unset
Remove a shell variable or function from the current environment.
- wait
Pause until background jobs or processes finish.
- who
Show who is currently logged in — listing each active session with username, terminal, login time, and remote host.
- whoami
Print the effective username of the current process — the identity files would be created as and that permissions checks resolve against.
- yum
Install, upgrade, and remove packages on RHEL / CentOS / Fedora / Amazon Linux via YUM (Yellowdog Updater, Modified) — the RPM-family package manager, succeeded by `dnf` in RHEL 8+.
Navigation (7)
- cd
Change the current working directory.
- dirs
List the directory stack built up by pushd and popd.
- pop-location
PowerShell's popd — return to the directory most recently pushed.
- popd
Pop the top directory off the directory stack and cd into it.
- push-location
PowerShell's pushd — save the current directory on a stack, then cd.
- pushd
Push the current directory onto a stack and cd into a new one.
- pwd
Print the current working directory.
Process (26)
- bg
Resume a stopped (Ctrl+Z’d) job and run it in the background.
- crontab
Schedule recurring commands on Unix — the user's `crontab` file lists `<minute> <hour> <day> <month> <weekday> <command>` entries that cron runs in the background.
- disown
Remove a background job from the shell's job table so it survives shell exit.
- dmesg
Print the kernel ring buffer — boot-time hardware probes, device hot-plug events, OOM killer activity, and other kernel-level diagnostics that don't go to userspace logs.
- fg
Bring a background or stopped job to the foreground.
- free
Display the system's used and free memory — total RAM, used, free, shared, buffer/cache, and swap, for quick "is this box memory-pressured" checks.
- get-process
PowerShell's process-listing cmdlet — the ps equivalent.
- get-service
PowerShell's service-listing cmdlet — like systemctl or service.
- jobs
List background and stopped jobs in the current shell session.
- journalctl
Query the systemd journal — the central binary log database on systemd-based Linux systems where boot logs, service stdout/stderr, and kernel ring buffer all live.
- kill
Send a signal to a process (typically to terminate it).
- lsof
List open files — including regular files, sockets, pipes, devices, and the processes holding them.
- nice
Launch a process with an adjusted scheduling priority (niceness).
- nohup
Run a command immune to SIGHUP so it survives the terminal closing.
- pgrep
Find PIDs (and optionally command lines) of running processes by name or other attribute — the lookup half of pkill/pgrep.
- pidof
Return the PID(s) of a running process by exact name — the simpler, Linux-only cousin of pgrep.
- pkill
Kill processes by name (or other attribute) without first looking up the PID.
- ps
List a snapshot of currently running processes.
- renice
Change the scheduling priority of an already-running process.
- screen
Detachable terminal multiplexer — sessions survive disconnects.
- start-process
PowerShell's process-launcher cmdlet — the equivalent of background `&` / `nohup` / `Start` for spawning detached or elevated processes.
- stop-service
PowerShell's stop-service cmdlet — like systemctl stop.
- strace
Trace system calls and signals received by a running process — Linux's ptrace-based syscall debugger. The canonical "why did my program fail with no useful error" tool.
- systemctl
Control systemd services — start, stop, enable at boot, and inspect status — on every modern Linux distro.
- top
Interactive process viewer — show running processes sorted by CPU or memory, refreshed in place.
- uname
Print kernel and OS identification — what kernel version, machine architecture, and OS family the script is running on, for portability branching.
Network (27)
- curl
Transfer data from or to a server over HTTP, HTTPS, FTP, and many other protocols.
- dig
Query DNS records (A, AAAA, MX, TXT) with richer output than nslookup.
- ftp
Transfer files over FTP — legacy plaintext protocol; prefer SFTP today.
- host
Simple DNS lookup with one-line output, simpler than dig.
- ifconfig
The legacy network interface configurator — still primary on macOS/BSD, deprecated on most Linux distros but still installed.
- invoke-restmethod
PowerShell's REST and JSON HTTP client — curl that auto-deserialises the response.
- invoke-webrequest
PowerShell's HTTP cmdlet — the curl / wget equivalent.
- ip
The modern Linux network utility (from `iproute2`) — manages addresses, links, routes, neighbours, tunnels, and namespaces.
- nc
Netcat — read/write arbitrary TCP and UDP data. Used for port probes, one-shot listeners, file transfer, and quick socket debugging.
- netstat
Show network connections, listening ports, routing tables, and interface statistics.
- nslookup
Query DNS records (A, AAAA, MX, TXT, etc.) for a hostname.
- ping
Send ICMP echo requests to test reachability and round-trip latency.
- rlogin
Remote login — DEPRECATED unencrypted predecessor to ssh.
- route
Display and manipulate the IP routing table — the rules that decide which interface and gateway each outbound packet uses.
- rsh
Remote shell — DEPRECATED unencrypted predecessor to ssh.
- rsync
Efficient file and directory sync, transferring only changed parts.
- scp
Securely copy files between hosts over SSH.
- sftp
Interactive file transfer over SSH — the secure replacement for FTP.
- ss
Socket statistics — the modern Linux replacement for `netstat`, querying kernel sockets directly via netlink.
- ssh
Open a secure shell on a remote host or run a remote command.
- ssh-keygen
Generate, inspect, and manage SSH key pairs — the asymmetric credentials used by SSH for passwordless authentication and host verification.
- telnet
Open a plaintext TCP session — legacy terminal + port-probe tool.
- test-connection
PowerShell's reachability-check cmdlet — the ping equivalent that returns structured objects and supports TCP port tests since pwsh 7.
- tracepath
Trace the network path to a destination — listing each hop and its round-trip time, without root privileges.
- traceroute
Print the route packets take to a network host — hop-by-hop, with per-hop round-trip times — by sending probes with incrementing TTL values.
- wget
Non-interactive network downloader for HTTP, HTTPS, and FTP.
- whois
Look up domain registration / WHOIS records.
Archive (7)
- 7z
Create, extract, and inspect 7-Zip archives (.7z, .zip, .tar.gz, and 30+ other formats) with strong LZMA2 compression and AES-256 encryption.
- bzip2
Compress / decompress single files using the bzip2 (BWT + Huffman) algorithm — better ratio than gzip, slower, single-threaded.
- gzip
Compress (or decompress) a single file in place using the DEFLATE algorithm.
- tar
Bundle and unbundle files into a single archive (often combined with gzip / bzip2 / xz).
- unzip
Extract files from a ZIP archive — the read side of `zip`, available on every Unix and (since Windows 10 1803) via the bundled bsdtar.
- xz
Compress / decompress files using the LZMA2 algorithm — best ratio of any mainstream compressor, slow at compress, fast at decompress, multi-threaded by default.
- zip
Package and compress files into a ZIP archive.
Permissions (9)
- chgrp
Change the group ownership of a file or directory on Unix systems.
- chmod
Change file mode bits (read / write / execute permissions) on Unix files.
- chown
Change the owner (and optionally the group) of a file or directory.
- getfacl
Display the POSIX.1e ACL of a file or directory — the per-user / per-group grants beyond the basic owner/group/other mode bits.
- setfacl
Set or modify the POSIX.1e ACL of a file or directory — grant per-user / per-group access beyond the basic owner/group/other mode bits.
- su
Switch to another user's identity in the current terminal — usually for becoming root or testing as a specific user.
- sudo
Execute a command with another user's privileges — usually root — without logging out and back in.
- umask
Set or display the default permission MASK for newly-created files and directories.
- usermod
Modify an existing user account — change username, home directory, shell, primary group, supplementary groups, lock / unlock the account, or set the expiration date.