cmd.exe — every common shell command
The legacy Windows command prompt. Limited but present on every Windows install.
cmd.exe vs PowerShell — they are not the same shell
cmd.exe and PowerShell both run on Windows, but they are different shells with different syntax, different pipe semantics, and almost no source-level compatibility. Knowing which one is open decides whether `dir` or `Get-ChildItem`, `%PATH%` or `$Env:Path`, `if exist file` or `if (Test-Path file)` is the right answer.
Origin & era
cmd.exeSuccessor to COMMAND.COM from MS-DOS, present on every Windows install since NT. The feature set has been frozen for decades — Microsoft no longer adds built-ins.
PowerShellDesigned from scratch in 2006 on top of .NET. PowerShell 5.1 ships with modern Windows; PowerShell 7+ (`pwsh`) is a separate cross-platform install.
What pipes carry
cmd.exeRaw text bytes. The next command parses lines itself with `find`, `findstr`, `for /f`, etc.
PowerShellTyped .NET objects with properties and methods. Downstream cmdlets read fields directly: `Get-Process | Where-Object CPU -gt 10`.
This is the deepest difference between the two shells. Most other quirks follow from text vs. objects.
Variables
cmd.exe`set NAME=value` to define. `%NAME%` to expand inside commands; `!NAME!` with delayed expansion enabled. No types — everything is an environment string.
PowerShell`$Name = value` to define. `$Name` to expand. Holds any object, with scopes (`$global:`, `$script:`, `$env:`).
Conditionals
cmd.exe`IF EXIST file (echo yes) ELSE (echo no)` — comparisons are `==`, `EQU`, `NEQ`, `LSS`, `GTR`.
PowerShell`if (Test-Path file) { "yes" } else { "no" }` — comparisons are `-eq`, `-ne`, `-lt`, `-gt`, `-match`. `==` is **not** a comparison operator.
Loops
cmd.exe`for %f in (*.log) do @echo %f` interactively, or `%%f` inside a `.bat`/`.cmd` file. `for /f` parses lines from files or command output.
PowerShell`Get-ChildItem *.log | ForEach-Object { $_.Name }` — or `foreach ($f in Get-ChildItem *.log) { ... }`. Pipeline-first.
Script files
cmd.exe`.bat` or `.cmd` — plain text, runs directly. No signing, no execution policy.
PowerShell`.ps1` — gated by execution policy. `Set-ExecutionPolicy RemoteSigned` is the usual unblock on Windows.
Cross-platform reach
cmd.exeWindows-only. Not part of WSL, not on macOS or Linux.
PowerShellPowerShell 7+ (`pwsh`) runs on Windows, macOS, and Linux. Cmdlets like `Get-ChildItem`, `Select-String`, `Invoke-WebRequest` work the same everywhere.
Unix-name commands
cmd.exeNo Unix aliases. `ls`, `cat`, `cp`, `mv`, `rm`, `grep` simply do not exist — use `dir`, `type`, `copy`, `move`, `del`, `findstr`.
PowerShell`ls`, `cat`, `cp`, `mv`, `rm`, `ps` are **aliases** for cmdlets. They accept PowerShell parameters, not Unix flags — `ls -la` errors with "parameter cannot be found".
This is the most common source of "but it worked on Linux" pain on Windows.
Comments
cmd.exe`REM comment` or `:: comment` (a label trick). No block-comment syntax.
PowerShell`# line comment` or `<# block comment #>`.
Quoting & escaping
cmd.exeEscape with `^` outside quotes; embed a literal quote with `""`. Limited interpolation — only `%VAR%` and `!VAR!`.
PowerShellEscape with backtick `` ` ``. Double quotes interpolate `$var` and `$()`; single quotes are literal.
All seeded commands in cmd.exe (227)
Files (48)
- add-contentPowerShell's append-to-file cmdlet — the equivalent of bash `>>` redirection that adds content to the end of an existing file.
echo hello >> file.txt - basenameStrip the directory part of a path, leaving only the final filename component.
for %I in ("C:\Windows\System32\drivers\etc\hosts") do @echo %~nxI - catPrint file contents to standard output.
type file.txt - command-vPOSIX way to test whether a command exists and where it resolves.
where /Q python3 - copy-itemPowerShell's copy cmdlet — the cp equivalent.
copy source dest - cpCopy files and directories.
copy source dest - ddCopy and convert files at the block level — used for disk imaging, raw I/O, and filling test files.
fsutil file createnew zeros.bin 1048576 - dfReport mounted-filesystem free space and inode usage.
wmic logicaldisk get caption,freespace,size - dirnameStrip the final filename component from a path, leaving only the directory part.
for %I in ("C:\Windows\System32\drivers\etc\hosts") do @echo %~dpI - duSummarize disk usage of files and directories.
dir /s /-c - fileIdentify a file by its magic bytes, not its extension.
# No native equivalent. Install via Git Bash, WSL, or a third-party package. - findLocate files by name, size, time, or other attributes.
dir /s /b *.log - get-childitemPowerShell's directory-listing cmdlet — the ls equivalent.
dir /s - get-commandPowerShell's command-introspection cmdlet — the which / type / command -v equivalent that returns rich CommandInfo objects.
where jq - get-contentPowerShell's file-read cmdlet — the cat / tail equivalent.
type file.txt - get-locationPowerShell's current-directory cmdlet — the pwd equivalent that returns a structured PathInfo object.
cd - lessPage through a file with backward navigation and search.
less file.txt - lnCreate a hard link or symbolic link to a file or directory.
mklink linkname target - lsList directory contents.
dir /a - lsblkList block devices (disks, partitions, LVM volumes, RAID arrays) as a tree showing size, mountpoint, and filesystem.
wmic logicaldisk get name,size,freespace,filesystem - md5sumPrint an MD5 hash of one or more files. Cryptographically broken — integrity-only.
certutil -hashfile file.bin MD5 - mkdirCreate a new directory.
mkdir dir - mktempCreate a uniquely-named temporary file (or directory) in a race-free way.
set TMPFILE=%TEMP%\tmp_%RANDOM%_%TIME:~6,2%%TIME:~9,2%.tmp & type nul > "%TMPFILE%" - moreView a file one screen at a time (basic pager).
more file.txt - mountAttach a filesystem (disk, image, network share) to a directory in the tree so its contents become accessible.
mountvol C:\Mount \\?\Volume{guid}\ - move-itemPowerShell's move/rename cmdlet — the mv equivalent.
move source dest - mvMove or rename files and directories.
move source dest - new-itemPowerShell's create-file/directory cmdlet — like touch + mkdir.
type nul > file.txt - out-filePowerShell's pipeline-to-file cmdlet — the equivalent of bash `>` redirection that writes formatted text output to a file.
command > out.txt - readlinkPrint the target of a symbolic link, or the canonical path.
dir /al .\symlink - realpathResolve a path to its absolute, canonical form.
for %i in (".\file") do @echo %~fi - remove-itemPowerShell's delete cmdlet — the rm / rmdir / del equivalent.
del file.txt - resolve-pathPowerShell's path-canonicalize cmdlet — the realpath equivalent.
for %i in (file.txt) do @echo %~fi - rmDelete files and directories.
del file - set-contentPowerShell's verbatim file-writer cmdlet — the equivalent of bash `>` that overwrites a file with raw, unformatted content.
echo hello > file.txt - set-locationPowerShell's working-directory cmdlet — the cd equivalent that also navigates registry and other PowerShell providers.
cd /d D:\projects - sha1sumPrint a SHA-1 hash of one or more files. Cryptographically broken — integrity-only.
certutil -hashfile file.bin SHA1 - sha256sumPrint a SHA-256 hash of one or more files.
certutil -hashfile file.bin SHA256 - sha512sumPrint a SHA-512 hash of one or more files — 128 hex chars, current best-practice for high-stakes integrity.
certutil -hashfile file.bin SHA512 - shasumBSD/macOS Perl wrapper that computes SHA-1 through SHA-512 hashes of files.
certutil -hashfile file.bin SHA256 - statPrint a file's size, mode, owner, and timestamps.
dir file.txt - test-pathPowerShell's path-existence cmdlet — the bash [ -e ] equivalent.
if exist C:\Windows\System32\notepad.exe (echo yes) - touchCreate an empty file or update its modification time if it exists.
type nul > file.txt - treePrint a directory tree showing files and subdirectories.
tree /F - typeShow how a name is interpreted — builtin, function, alias, or file.
type file.txt - umountDetach a previously mounted filesystem from its directory in the tree, flushing pending writes first.
mountvol C:\Mount /D - whereisLocate the binary, source, and manual page for a command.
where ls - whichLocate an executable in PATH and print its full path.
where python3
Text (46)
- awkPattern scanning and processing language for structured text.
for /f "tokens=1" %a in (file) do @echo %a - bcArbitrary-precision command-line calculator that evaluates an expression and prints the result.
set /a "2 + 2" - cmpByte-by-byte comparison of two files — the binary counterpart to diff.
fc /b a.bin b.bin - columnFormat whitespace- or delimiter-separated input into aligned columns.
rem No native equivalent — shell out to PowerShell - commCompare two SORTED files line by line, emitting three columns: only-in-file1, only-in-file2, in-both.
fc /b file1.txt file2.txt - compare-objectPowerShell's set-difference cmdlet — the diff equivalent for comparing two collections of objects or text.
fc file1 file2 - convertfrom-jsonParse a JSON string into PowerShell objects you can pipe and filter.
powershell -NoProfile -Command "Get-Content users.json | ConvertFrom-Json | ForEach-Object { $_.name }" - convertto-jsonSerialise a PowerShell object graph to a JSON string.
powershell -NoProfile -Command "@{name='alice'} | ConvertTo-Json -Compress" - cutExtract sections (fields or characters) from each line.
for /f "tokens=1 delims=," %a in (file.csv) do @echo %a - diffCompare two files or directories line-by-line and report the differences.
fc file1.txt file2.txt - echoPrint arguments to standard output, separated by spaces, followed by a newline.
echo hello world - export-csvWrite PowerShell objects to a CSV file with a header row.
powershell -NoProfile -Command "$users | Export-Csv users.csv -NoTypeInformation" - grepSearch file contents for a pattern.
findstr /S /I "pattern" * - group-objectPowerShell's grouping cmdlet — the `sort | uniq -c` equivalent that buckets items by a property and returns counts plus the underlying groups.
sort file.txt | find /c /v "" - headOutput the first lines of a file.
powershell -Command "Get-Content file -TotalCount 10" - hexdumpBSD-style hexadecimal dump — flexible format strings for byte-level inspection.
certutil -dump file.bin - iconvConvert text between character encodings (UTF-8, UTF-16, Latin-1, GBK, …) with optional transliteration.
powershell -Command "[IO.File]::WriteAllText('output.txt', [IO.File]::ReadAllText('input.txt', [Text.Encoding]::UTF8), [Text.Encoding]::Unicode)" - import-csvRead a CSV file into PowerShell objects, inferring property names from the header row.
powershell -NoProfile -Command "Import-Csv users.csv | ForEach-Object { $_.name }" - jqCommand-line JSON processor — filter, transform, and build JSON from the shell.
curl -s https://api.example.com/users | jq ".[] | .name" - measure-objectPowerShell's aggregation cmdlet — counts items and computes sum/min/max/average, similar to wc plus awk arithmetic.
find /v /c "" file.txt - nlNumber the lines of a file (or stdin), emitting line numbers followed by each line.
findstr /N "^" file.txt - odDump file contents in octal, hexadecimal, decimal, or character form — for binary inspection.
certutil -dump file.bin - pasteMerge corresponding lines of two or more files side-by-side, tab-separated by default.
powershell -Command "$a=gc a.txt;$b=gc b.txt;0..($a.Count-1)|%{\"$($a[$_])`t$($b[$_])\"}" - patchApply a unified diff to source files, transforming them in place.
git apply changes.patch - sedStream editor for filtering and transforming text.
powershell -Command "(Get-Content file) -replace 'old','new'" - select-objectPowerShell's projection cmdlet — picks specific properties or the first/last N objects, like cut + head + tail combined.
command | more +1 /e - select-stringPowerShell's pattern-search cmdlet — the grep equivalent.
findstr "pattern" file.txt - seqGenerate an arithmetic sequence of numbers (1, 2, 3, … N) — one per line by default.
for /L %I in (1,1,10) do @echo %I - sortSort lines of text.
sort file - sort-objectPowerShell's sort cmdlet — sorts pipeline objects by one or more properties.
sort /+10 /R input.txt - splitSplit a large file into smaller chunks by line count, byte size, or chunk count.
powershell -Command "$l=gc huge.txt;for($i=0;$i -lt $l.Count;$i+=1000){$l[$i..($i+999)]|sc \"chunk_$([Math]::Floor($i/1000)).txt\"}" - stringsExtract printable ASCII (and optionally UTF-16) sequences from binary files.
strings.exe file.bin - tacConcatenate and print files in reverse line order.
powershell -NoProfile -Command "$l=Get-Content file.txt; $l[($l.Count-1)..0]" - tailOutput the last lines of a file.
powershell -Command "Get-Content file -Tail 10" - teeRead stdin and write to both stdout and one or more files at once.
(command) > output.txt & type output.txt - trTranslate or delete characters from input.
powershell -Command "Get-Content file | ForEach-Object { $_.ToUpper() }" - uniqFilter adjacent duplicate lines.
powershell -Command "Get-Content file | Sort-Object -Unique" - wcCount lines, words, or bytes.
find /c /v "" file - where-objectPowerShell's pipeline filter cmdlet — the awk/grep equivalent for filtering objects by property.
command | findstr "pattern" - write-hostPowerShell's host-UI writer — the coloured-banner echo that bypasses the pipeline and prints directly to the terminal.
echo hello - write-outputPowerShell's pipeline-emitter cmdlet — the echo equivalent that sends objects, not just text, down the pipeline.
echo hello - xargsBuild and execute command lines from standard input.
for /f "delims=" %f in ('dir /s /b *.tmp') do del "%f" - xmllintParse, validate, and query XML documents on the command line — from the libxml2 project. XPath queries, DTD/XSD validation, pretty-printing, and XInclude resolution.
xmllint --xpath "//book[@id='1']/title/text()" books.xml - xxdHexadecimal dump utility — show file contents as hex bytes plus ASCII gutter.
certutil -dump file.bin - yesEmit a string (default "y") repeatedly until killed — used to auto-confirm interactive prompts.
for /L %i in (1,0,2) do @echo y - yqQuery, 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).
yq ".spec.replicas" deployment.yaml
Shell (57)
- aliasCreate a shortcut name for a longer command line.
doskey ll=dir /a $* - aptInstall, upgrade, and remove packages on Debian / Ubuntu / Mint via the APT package manager — the canonical "install software" command for Debian-family Linux.
winget install nginx - bang-bangHistory expansion `!!` — repeat the previous command.
F3 - bang-dollarHistory expansion `!$` — last argument of the previous command.
(no equivalent) - breakExit the innermost (or N-th enclosing) loop.
for %i in (1 2 3) do (if "%i"=="2" goto :done & echo %i) :done - brewInstall, upgrade, and remove packages on macOS (and Linux) via Homebrew — the de-facto macOS package manager, also installable as Linuxbrew on Debian / RHEL.
winget install BurntSushi.ripgrep.MSVC - clear-hostPowerShell's terminal-clearing cmdlet — the clear / cls equivalent that wipes the visible scrollback.
cls - continueSkip to the next iteration of the innermost (or N-th enclosing) loop.
for %i in (1 2 3) do (if not "%i"=="2" echo %i) - datePrint 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".
date /T - declareDeclare a variable, an array, or set variable attributes.
set /a count=0 - dialogGenerate ncurses-style TUI widgets (menus, prompts, checkboxes, gauges, password fields) from shell scripts — capture user input as exit-code + stderr text.
set /p name="Enter your name: " - double-bracket[[ ]] extended test in bash/zsh with regex and patterns.
if /i "%name%"=="alice" (echo yes) - envPrint the current environment variables — every `NAME=value` pair exported into the running process, plus the gateway for running a command with a modified environment.
set - evalParse and execute a string as if it were a shell command.
call %cmd% - execReplace the current shell with another program.
cmd /c python script.py - exitTerminate the current shell or script with an optional exit status.
exit /b 0 - expectAutomate interactive command-line programs — Tcl-based scripting tool that "expects" patterns in a program's output and "sends" responses, like a programmable user.
wsl expect -c "spawn ssh user@host; expect password:; send secret\r; interact" - exportSet an environment variable and mark it for export to child processes.
set NAME=value - exprEvaluate an expression (POSIX arithmetic / string ops).
set /a result=2+3 - fcEdit and re-run the previous command in $EDITOR.
doskey /history - foreach-objectPowerShell's pipeline-loop cmdlet — the xargs / while-read equivalent for running a block per object.
for /f "delims=" %i in ('command') do @echo %i - functionDefine a reusable named function in a shell script.
call :greet World - get-datePowerShell's current-time and date-arithmetic cmdlet.
date /t - get-helpPowerShell's documentation cmdlet — the man / info equivalent that pulls help text for cmdlets, functions, and conceptual topics.
help dir - get-memberPowerShell object introspection — list properties, methods, and events on an object.
powershell -NoProfile -Command "$obj | Get-Member" - getoptsParse short option flags inside a shell script.
:parse - gpgOpenPGP encryption, signing, and key management — GnuPG.
gpg.exe --encrypt --recipient RECIPIENT-KEY-ID file - groupsList the groups a user belongs to — controlling which files, devices, and capabilities the user can access via group permissions.
whoami /groups - historyShow previously run commands from the shell history.
doskey /history - idPrint the current user's UID, GID, and group memberships.
whoami /all - invoke-expressionPowerShell's runtime string-evaluator cmdlet — the `eval` equivalent that parses and executes a string as code. Powerful and dangerous.
call %cmdVar% - letBash/zsh arithmetic-evaluation builtin — assign integer expressions to variables.
set /a x=y*2 - manDisplay the manual page for a command — the canonical authoritative documentation that ships with the binary, before tutorials or Stack Overflow answers.
<command> /? - passwdChange a user account password — set, expire, lock, or unlock.
net user alice * - pipInstall, upgrade, and remove Python packages from PyPI — Python's standard package manager, identical CLI across Linux, macOS, and Windows.
pip install requests - printenvPrint 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.
echo %PATH% - printfPrint formatted text using C-style format specifiers like %s and %d.
echo hello - readRead a line of input into one or more shell variables interactively.
set /p name=Name: - read-hostPowerShell interactive prompt — read a string (or SecureString) from the user.
set /p name=Enter name: - returnExit a shell function with a numeric status code.
exit /b 1 - rpmInstall, query, verify, and uninstall individual `.rpm` package files on RHEL / CentOS / Fedora / SUSE — the low-level package backend underneath yum/dnf/zypper.
msiexec /i package.msi /qn - setToggle shell options like errexit/xtrace and set positional parameters.
set VAR=value - sleepPause execution for a number of seconds.
timeout /t 5 /nobreak - sourceLoad a script into the current shell so its definitions persist.
call script.bat - testEvaluate a conditional — file tests, string and number comparisons.
if exist C:\Windows\System32 (echo yes) - timeMeasure how long a command takes to run.
powershell -Command "Measure-Command { some_command }" - timesShow accumulated CPU time used by the shell and its children.
wmic process get Name,UserModeTime,KernelModeTime - tmuxTerminal multiplexer — keep multiple shell sessions alive in one terminal, detach and reattach across SSH disconnects, and split panes for side-by-side work.
wsl tmux new -s work - trapRun a handler when the shell receives a signal or exits.
(commands) & cleanup - typesetDeclare a variable or set its attributes (zsh canonical name).
set /a count=0 - ulimitRead or set the shell process's resource limits (open files, stack, memory, …).
rem No native equivalent - unaliasRemove an alias previously defined with alias.
doskey ll= - unsetRemove a shell variable or function from the current environment.
set FOO= - waitPause until background jobs or processes finish.
start /wait program.exe - whoShow who is currently logged in — listing each active session with username, terminal, login time, and remote host.
query user - whoamiPrint the effective username of the current process — the identity files would be created as and that permissions checks resolve against.
whoami - yumInstall, 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+.
winget install nginx
Navigation (7)
- cdChange the current working directory.
cd /d D:\path\to\dir - dirsList the directory stack built up by pushd and popd.
pushd - pop-locationPowerShell's popd — return to the directory most recently pushed.
popd - popdPop the top directory off the directory stack and cd into it.
popd - push-locationPowerShell's pushd — save the current directory on a stack, then cd.
pushd C:\Windows - pushdPush the current directory onto a stack and cd into a new one.
pushd C:\Users - pwdPrint the current working directory.
cd
Process (26)
- bgResume a stopped (Ctrl+Z’d) job and run it in the background.
start /b command - crontabSchedule recurring commands on Unix — the user's `crontab` file lists `<minute> <hour> <day> <month> <weekday> <command>` entries that cron runs in the background.
schtasks /create /sc DAILY /st 03:00 /tn Backup /tr "C:\backup.bat" - disownRemove a background job from the shell's job table so it survives shell exit.
start /b long-job.exe - dmesgPrint 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.
wevtutil qe System /q:"*[System[Provider[@Name='Microsoft-Windows-Kernel-General']]]" /f:text - fgBring a background or stopped job to the foreground.
start /wait command - freeDisplay the system's used and free memory — total RAM, used, free, shared, buffer/cache, and swap, for quick "is this box memory-pressured" checks.
wmic OS get FreePhysicalMemory,TotalVisibleMemorySize /value - get-processPowerShell's process-listing cmdlet — the ps equivalent.
tasklist - get-servicePowerShell's service-listing cmdlet — like systemctl or service.
sc query - jobsList background and stopped jobs in the current shell session.
tasklist /fi "username eq %USERNAME%" - journalctlQuery 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.
wevtutil qe System /c:50 /f:text /rd:true - killSend a signal to a process (typically to terminate it).
taskkill /pid <pid> - lsofList open files — including regular files, sockets, pipes, devices, and the processes holding them.
netstat -ano | findstr :8080 - niceLaunch a process with an adjusted scheduling priority (niceness).
start /low long-running-job.exe - nohupRun a command immune to SIGHUP so it survives the terminal closing.
start /b cmd-or-exe - pgrepFind PIDs (and optionally command lines) of running processes by name or other attribute — the lookup half of pkill/pgrep.
tasklist /FI "IMAGENAME eq firefox.exe" - pidofReturn the PID(s) of a running process by exact name — the simpler, Linux-only cousin of pgrep.
tasklist /FI "IMAGENAME eq firefox.exe" /NH /FO CSV - pkillKill processes by name (or other attribute) without first looking up the PID.
taskkill /IM firefox.exe /F - psList a snapshot of currently running processes.
tasklist - reniceChange the scheduling priority of an already-running process.
wmic process where ProcessId=1234 CALL setpriority 16384 - screenDetachable terminal multiplexer — sessions survive disconnects.
# No native equivalent. Use Windows Terminal tabs + WSL screen/tmux. - start-processPowerShell's process-launcher cmdlet — the equivalent of background `&` / `nohup` / `Start` for spawning detached or elevated processes.
start /b long-task - stop-servicePowerShell's stop-service cmdlet — like systemctl stop.
sc stop w3svc - straceTrace 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.
procmon.exe /BackingFile C:\trace.pml - systemctlControl systemd services — start, stop, enable at boot, and inspect status — on every modern Linux distro.
sc start nginx - topInteractive process viewer — show running processes sorted by CPU or memory, refreshed in place.
tasklist - unamePrint kernel and OS identification — what kernel version, machine architecture, and OS family the script is running on, for portability branching.
ver
Network (27)
- curlTransfer data from or to a server over HTTP, HTTPS, FTP, and many other protocols.
curl https://example.com - digQuery DNS records (A, AAAA, MX, TXT) with richer output than nslookup.
nslookup example.com - ftpTransfer files over FTP — legacy plaintext protocol; prefer SFTP today.
ftp -s:commands.txt - hostSimple DNS lookup with one-line output, simpler than dig.
nslookup example.com - ifconfigThe legacy network interface configurator — still primary on macOS/BSD, deprecated on most Linux distros but still installed.
ipconfig - invoke-restmethodPowerShell's REST and JSON HTTP client — curl that auto-deserialises the response.
curl -s https://api.example.com/users/1 - invoke-webrequestPowerShell's HTTP cmdlet — the curl / wget equivalent.
curl https://example.com - ipThe modern Linux network utility (from `iproute2`) — manages addresses, links, routes, neighbours, tunnels, and namespaces.
ipconfig /all - ncNetcat — read/write arbitrary TCP and UDP data. Used for port probes, one-shot listeners, file transfer, and quick socket debugging.
powershell -NoProfile -Command "Test-NetConnection host -Port 80" - netstatShow network connections, listening ports, routing tables, and interface statistics.
netstat -ano - nslookupQuery DNS records (A, AAAA, MX, TXT, etc.) for a hostname.
nslookup example.com - pingSend ICMP echo requests to test reachability and round-trip latency.
ping example.com - rloginRemote login — DEPRECATED unencrypted predecessor to ssh.
ssh user@host - routeDisplay and manipulate the IP routing table — the rules that decide which interface and gateway each outbound packet uses.
route print - rshRemote shell — DEPRECATED unencrypted predecessor to ssh.
ssh user@host command - rsyncEfficient file and directory sync, transferring only changed parts.
robocopy src dest /E /Z - scpSecurely copy files between hosts over SSH.
scp local.txt user@host:/tmp/ - sftpInteractive file transfer over SSH — the secure replacement for FTP.
sftp user@host - ssSocket statistics — the modern Linux replacement for `netstat`, querying kernel sockets directly via netlink.
netstat -ano - sshOpen a secure shell on a remote host or run a remote command.
ssh user@host - ssh-keygenGenerate, inspect, and manage SSH key pairs — the asymmetric credentials used by SSH for passwordless authentication and host verification.
ssh-keygen -t ed25519 -C "[email protected]" - telnetOpen a plaintext TCP session — legacy terminal + port-probe tool.
telnet example.com 25 - test-connectionPowerShell's reachability-check cmdlet — the ping equivalent that returns structured objects and supports TCP port tests since pwsh 7.
ping -n 4 example.com - tracepathTrace the network path to a destination — listing each hop and its round-trip time, without root privileges.
tracert google.com - traceroutePrint the route packets take to a network host — hop-by-hop, with per-hop round-trip times — by sending probes with incrementing TTL values.
tracert google.com - wgetNon-interactive network downloader for HTTP, HTTPS, and FTP.
curl -O https://example.com/file.zip - whoisLook up domain registration / WHOIS records.
whois.exe example.com
Archive (7)
- 7zCreate, extract, and inspect 7-Zip archives (.7z, .zip, .tar.gz, and 30+ other formats) with strong LZMA2 compression and AES-256 encryption.
7z x archive.7z - bzip2Compress / decompress single files using the bzip2 (BWT + Huffman) algorithm — better ratio than gzip, slower, single-threaded.
powershell -NoProfile -Command "& '$env:ProgramFiles\7-Zip\7z.exe' a -tbzip2 file.bz2 file.txt" - gzipCompress (or decompress) a single file in place using the DEFLATE algorithm.
tar -czf file.tar.gz file - tarBundle and unbundle files into a single archive (often combined with gzip / bzip2 / xz).
tar -czf archive.tar.gz dir - unzipExtract files from a ZIP archive — the read side of `zip`, available on every Unix and (since Windows 10 1803) via the bundled bsdtar.
tar -xf archive.zip - xzCompress / decompress files using the LZMA2 algorithm — best ratio of any mainstream compressor, slow at compress, fast at decompress, multi-threaded by default.
powershell -NoProfile -Command "& '$env:ProgramFiles\7-Zip\7z.exe' a -txz -mx=9 file.xz file.txt" - zipPackage and compress files into a ZIP archive.
tar -a -cf archive.zip dir
Permissions (9)
- chgrpChange the group ownership of a file or directory on Unix systems.
icacls file /grant "devs":(RX) - chmodChange file mode bits (read / write / execute permissions) on Unix files.
icacls file /grant Users:(RX) - chownChange the owner (and optionally the group) of a file or directory.
takeown /f file - getfaclDisplay the POSIX.1e ACL of a file or directory — the per-user / per-group grants beyond the basic owner/group/other mode bits.
icacls file.txt - setfaclSet 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.
icacls file.txt /grant "alice:(F)" - suSwitch to another user's identity in the current terminal — usually for becoming root or testing as a specific user.
runas /user:alice cmd.exe - sudoExecute a command with another user's privileges — usually root — without logging out and back in.
runas /user:Administrator "cmd /c whoami" - umaskSet or display the default permission MASK for newly-created files and directories.
rem cmd has no umask equivalent. Inheritance-based: icacls dir /inheritance:e - usermodModify an existing user account — change username, home directory, shell, primary group, supplementary groups, lock / unlock the account, or set the expiration date.
net user alice /comment:"Updated"