Command reference
396 commands, each with the options you actually use, real examples and the gotchas that bite in production.
A
aa-statusdisplay various information about the current AppArmor policyaliasdefine or display aliasesamtoolView and modify the current Alertmanager stateansibleDefine and run a single task "playbook" (an ad-hoc command) against a set of hostsansible-configView ansible configurationansible-docplugin documentation toolansible-galaxyPerform various Role and Collection related operationsansible-inventoryShow Ansible inventory information, by default it uses the inventory script JSON formatansible-lintlint tool for Ansible playbooks, roles and collectionsansible-playbookRuns Ansible playbooks, executing the defined tasks on the targeted hostsansible-vaultencryption/decryption utility for Ansible data filesapparmor_parserloads AppArmor profiles into the kernelapropossearch the manual page names and descriptionsaptpackage manager for Debian and Ubuntuapt-cachequery the APT package cacheapt-getpackage manager for Debian and Ubuntuapt-markmark packages held (never upgraded by apt upgrade)argocdArgo CD command line (v3.5)arpmanipulate the system ARP cache (net-tools, deprecated)awkpattern scanning and processing languageawsUniversal Command Line Interface for Amazon Web Services (AWS CLI v2)azAzure command-line interfaceazcopyAzCopy: copy data to and from Azure Storage (blobs, files).
B
base64base64 encode/decode data and print to standard outputbasenamestrip directory and suffix from a filenamebashGNU Bourne-Again SHellbgresume a job in the backgroundbiolatency-bpfccSummarize block device I/O latency as a histogrambiosnoop-bpfccTrace block I/Oblkidlocate/print block device attributesbpftooltool for inspection and simple manipulation of eBPF programs and mapsbpftraceHigh-level tracing language for Linuxbreakleave a loop (bash builtin)
C
cachestat-bpfccCount cache kernel function callscapshcapability shell wrappercatconcatenate files and print on the standard outputcdchange the working directorycfn-signalsend a success or failure signal for a CloudFormation resource with a CreationPolicy (aws-cfn-bootstrap)checkovstatic analysis of infrastructure as code for security and compliance misconfigurationschgrpchange group ownershipchmodchange file mode bitschownchange file owner and groupclearclear the terminal screencloud-initthe first-boot initialisation of cloud instances (user data, SSH keys, hostname, packages)cmctlmanage and inspect cert-manager resourcescmpcompare two files byte by bytecolumncolumnate listscommandrun a command bypassing functions and aliasesconntrackcommand line interface for netfilter connection trackingcontinueskip to the next iteration of a loop (bash builtin)cosigna tool for Container Signing, Verification and Storage in an OCI registry (Sigstore cosign)cpcopy files and directoriescpudist-bpfccSummarize on- and off-CPU time per task as a histogram.cranea tool for interacting with remote images and registries (go-containerregistry)createdbcreate a new PostgreSQL databasecreateuserdefine a new PostgreSQL user accountcrictlCLI for CRI-compatible container runtimes (containerd) - what the kubelet seescrossplaneThe Crossplane command-line tool (crossplane/cli v2.5.0): trace, render, packages, XRDscurltransfer a URLcutremove sections from each line
D
dateprint or set the system date and timedeactivateleave a Python virtual environment (a shell function the venv's activate script defines)declaredeclare variables and give them attributesdfreport filesystem disk space usagediffcompare files line by linedigDNS lookup utilitydirnamestrip the last component from a filenamedisownremove jobs from the shell's job table (bash builtin)dmesgprint or control the kernel ring bufferdockerDocker image and container command line interfacedocker-composeDefine and run multi-container applicationsdpkgDebian package manager, one level below aptdropdbremove a PostgreSQL databasedropuserremove a PostgreSQL user accountduestimate file space usage
E
echodisplay a line of textegrepgrep -Eenvrun a program in a modified environment, or print the environmentetcdctletcd v3 client (etcd 3.6: talks to a live member)etcdutletcd offline utility: works on snapshot files and data directoriesevalevaluate arguments as a shell commandexecreplace the shell with a commandexecsnoop-bpfccTrace exec() syscallsexitexit the shellexportset an export attribute for shell variablesext4dist-bpfccSummarize ext4 operation latencyext4slower-bpfccTrace common ext4 file operations slower than a thresholdexternal-dnskeep DNS records in step with Kubernetes Services, Ingresses and Gateway routes
F
falsedo nothing, unsuccessfullyfgresume a job in the foregroundfgrepgrep -Ffiledetermine file typefindsearch for files in a directory hierarchyfindmntfind a filesystem in the mount treeflamegraph.pldraw a flame graph (SVG) from folded stacksfortioload testing and echo server from the Istio projectfreedisplay amount of free and used memoryfstrimdiscard unused blocks on a mounted filesystemfunccount-bpfccCount functions, tracepoints, and USDT probes
G
gawkpattern scanning and processing languagegetentget entries from Name Service Switch librariesgetoptsparse option arguments in a shell scriptgitthe stupid content trackergpasswdadminister /etc/groupgpgOpenPGP encryption and signing toolgrepprint lines matching a patterngroupaddcreate a new groupgroupdeldelete a groupgroupsprint the groups a user is ingrowpartextend a partition in a partition table to fill available spacegunzipexpand gzip files (FILE.gz -> FILE)gzipcompress or expand files
H
I
idprint real and effective user and group IDsifconfigconfigure a network interface (net-tools, deprecated)incident(simulator) the incident room: channel, pager, roles, updates, status page, on an incident clockingress2gatewayconvert Ingress manifests to Gateway API manifestsioniceset or get process I/O scheduling class and priorityiostatReport Central Processing Unit (CPU) statistics and input/output statistics for devices and partitionsiotopsimple top-like I/O monitoripshow and manipulate routing, devices and addressesip6tablesadministration tool for IPv6 packet filtering and NAT (nf_tables backend)ip6tables-savedump ip6tables rulesipcalcsimple IP network calculatoriptablesadministration tool for IPv4 packet filtering and NAT (nf_tables backend)iptables-savedump iptables rulesistioctlIstio configuration command line utility
J
javalaunch a Java applicationjcmdsend diagnostic command requests to a running Java Virtual Machinejinfogenerate Java configuration information for a specified Java processjmapprint details of a specified processjobslist active jobsjournalctlquery the systemd journaljpslist the instrumented JVMs on the target systemjqcommand-line JSON processorjstackprint Java thread stack traces for a running Java processjstatmonitor JVM statistics
K
kafka-cluster.shthe Kafka cluster tool: cluster id, endpoints, unregister a brokerkafka-configs.shadd, remove and describe dynamic configs of topics, brokers, clients, users and groupskafka-console-consumer.shread data from Kafka topics and write it to standard outputkafka-console-producer.shread data from standard input and publish it to Kafkakafka-consumer-groups.shlist, describe, reset and delete consumer groupskafka-get-offsets.shprint the offsets of topic partitionskafka-jmx.shread JMX metrics from a Kafka nodekafka-leader-election.shelect partition leaders: preferred or uncleankafka-log-dirs.shdescribe the log directories of brokerskafka-metadata-quorum.shdescribe the KRaft metadata quorumkafka-producer-perf-test.sha producer load testkafka-reassign-partitions.shmove partition replicas between brokerskafka-server-start.shstart a Kafka broker or controller in the foregroundkafka-storage.shformat and inspect the log directories of a KRaft nodekafka-topics.shcreate, delete, describe, or change a topickeytoolmanage a Java keystore of cryptographic keys, certificate chains and trusted certificateskillsend a signal to a processkillallkill processes by exact namekube-benchrun CIS Kubernetes Benchmark checks against a Kubernetes deployment (Aqua Security kube-bench)kube-linterlint Kubernetes YAML and Helm charts against security and production-readiness checks (StackRox kube-linter 0.8)kubeadmbootstrap and operate a kubeadm clusterkubectlkubectl controls the Kubernetes cluster managerkubectl attachAttach to a running containerkubectl authInspect authorizationkubectl autoscaleAuto-scale a deployment, replica set, stateful set, or replication controllerkubectl certificateApprove or deny certificate signing requestskubectl cpCopy files and directories to and from containerskubectl createCreate a resource from a file or from stdin, or with a generatorkubectl create-ingressCreate an ingress with the specified namekubectl debugCreate debugging sessions for troubleshooting workloads and nodeskubectl drainDrain node in preparation for maintenancekubectl port-forwardForward one or more local ports to a podkubectl proxyRun a proxy to the Kubernetes API serverkubeletthe node agent (run by systemd as kubelet.service)kubeloginclient-go credential plugin for Entra ID (Azure AD) authentication to AKSkubesealencrypt a Kubernetes Secret into a SealedSecret only the cluster's controller can decryptkubesecscore a Kubernetes manifest's security settings (controlplane.io kubesec 2.15)kustomizetemplate-free customization of Kubernetes YAML (v5.7)
L
lab-vm(simulator) the hypervisor console for the lab VMslesspage through text one screen at a timeletevaluate arithmetic expressionslnmake links between fileslocalcreate a function-local variablelogcliCommand-line client for Lokilogoutexit a login shelllslist directory contentslsb_releaseprint distribution-specific informationlsblklist block deviceslsmodshow the loaded kernel moduleslsnslist namespaceslsoflist open fileslspcilist PCI deviceslvextendadd space to an LVM logical volume
M
mailprocess mail messages (GNU mailutils)manan interface to the system reference manualsmapfileread lines from stdin into an arraymawkpattern scanning and processing languagemkdirmake directoriesmkfs.ext4create an ext4 filesystemmktempcreate a temporary file or directory safelymodprobeadd a kernel modulemorepage through text one screen at a timemountmount a filesystem, or list what is mountedmpstatReport processors related statisticsmtra network diagnostic tool combining traceroute and pingmvmove (rename) files
N
nameifollow a pathname until a terminal point is foundnanoa small and friendly text editorncarbitrary TCP and UDP connections and listens (OpenBSD netcat)nerdctla docker-compatible CLI for containerdnetplanYAML network configuration abstraction for various backendsnetstatprint network connections, routing tables, interface statistics, masquerade connections, and multicast memberships (net-tools)networkctlQuery or modify the status of network links (systemd-networkd)newgrplog in to a new groupnftAdministration tool of the nftables framework for packet filtering and classificationnginxsmall, but very powerful and efficient web servernicerun a program with modified scheduling prioritynlnumber lines of filesnohuprun a command immune to hangups, with output to a non-ttynprocprint the number of processing units availablenpxRun a command from a local or remote npm packagensenterrun program in different namespacesnslookupquery Internet name serversnstatnetwork statistics tool
O
ocOpenShift command-line client: kubectl plus the OpenShift APIsoc admTools for managing an OpenShift clusteroc debugLaunch a new instance of a pod for debuggingoc exposeExpose a replicated application as a service or routeoc loginLog in to a serveroc new-appCreate a new applicationoc start-buildStart a new buildoc statusShow a high level overview of the current projectoddump files in octal and other formatsoffcputime-bpfccSummarize off-CPU time by stack traceopensnoop-bpfccTrace open() syscallsopensslOpenSSL command line program
P
parteda partition manipulation programpastemerge lines of files side by side (GNU coreutils)patchapply a diff file to an originalperfPerformance analysis tools for Linuxpg_archivecleanupclean up PostgreSQL WAL archive filespg_basebackuptake a base backup of a running PostgreSQL serverpg_conftoolread and edit PostgreSQL cluster configuration files (postgresql-common)pg_controldatadisplay control information of a PostgreSQL database clusterpg_createclustercreate a new PostgreSQL cluster (postgresql-common)pg_ctlinitialize, start, stop, or control a PostgreSQL serverpg_ctlclusterstart/stop/restart/reload/promote a PostgreSQL cluster (postgresql-common)pg_dropclustercompletely delete a PostgreSQL cluster (postgresql-common)pg_dumpextract a PostgreSQL database into a script file or other archive filepg_dumpallextract a PostgreSQL database cluster into a script filepg_isreadycheck the connection status of a PostgreSQL serverpg_lsclustersshow information about all PostgreSQL clusters (postgresql-common)pg_restorerestore a PostgreSQL database from an archive file created by pg_dumppgbouncerlightweight connection pooler for PostgreSQL (PgBouncer 1.25)pgreplist process IDs matching a patternpidoffind the process ID of a running programpidstatReport statistics for Linux taskspilot-agentthe Istio agent in every istio-proxy container: it starts Envoy, fetches its certificates and answers health checkspingsend ICMP ECHO_REQUEST to network hostspipthe Python package installerpip3the Python package installerpipxinstall and run Python applications in isolated environmentspkillsignal processes by name or other attributepodmandaemonless, rootless-capable container engine with a docker-compatible CLIpoweroffpower off the machineprintenvprint all or part of the environmentprintfformat and print dataprofile-bpfccProfile CPU stack traces at a timed intervalprometheusThe Prometheus monitoring serverprometheus-postgres-exporterPrometheus exporter for PostgreSQL server metrics (postgres_exporter 0.19)promtoolTooling for the Prometheus monitoring systempsreport a snapshot of the current processespsqlPostgreSQL interactive terminalpstreedisplay a tree of processespwdprint name of current working directorypytestsimple powerful testing with Pythonpythonan interpreted, interactive, object-oriented programming languagepython3an interpreted, interactive, object-oriented programming language
R
readread a line from standard inputreadarrayread lines from stdin into an array (bash builtin, same as mapfile)readlinkprint the target of a symbolic linkreadonlymark variables as unchangeablerealpathprint the resolved absolute pathnamerebootreboot the machineredis-clithe Redis command line interface (redis-tools)renicealter priority of running processesresize2fsext2/ext3/ext4 file system resizerresolvectlresolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services; introspect and reconfigure the DNS resolverreturnreturn from a shell functionrevreverse the characters of every linermremove files or directoriesrmdirremove empty directoriesrunqlat-bpfccSummarize run queue (scheduler) latency as a histogramrunqlen-bpfccSummarize scheduler run queue length as a histogram
S
sarCollect, report, or save system activity informationscpOpenSSH secure file copysedstream editor for filtering and transforming textseqprint a sequence of numberssession-manager-pluginthe AWS Session Manager plugin: the client side of `aws ssm start-session`setset or unset shell options and positional parameterssetsidrun a program in a new sessionshcommand interpreter (on Ubuntu, a link to dash; here bash in POSIX mode)sha256sumcompute SHA256 message digestshellcheckstatic analysis tool for shell scriptsshiftshift positional parametersshutdownhalt, power off or reboot the machineskopeocommand line utility to inspect and copy container images and image repositories, without pulling or a daemonsleepdelay for a specified timesnapmanage snap packages (Canonical's self-contained, auto-updating packages)sortsort lines of text filessourceread and execute a file in the current shellssanother utility to investigate socketssshOpenSSH remote login clientssh-copy-iduse locally available keys to authorise logins on a remote machinessh-keygenauthentication key generationstackcollapse-perf.plfold perf script output into one line per unique stackstatdisplay file or filesystem statusstracetrace system calls and signalssurun a command with substitute user and group IDsudoexecute a command as another userswapoffdisable swapswaponenable swap, or show what is in usesyftgenerate a packaged-based Software Bill Of Materials (SBOM) from container images and filesystems (Anchore syft)syncsynchronize cached writes to persistent storagesyscount-bpfccSummarize syscall counts and latencies.sysctlconfigure kernel parameters at runtimesystemctlcontrol the systemd system and service managersystemd-analyzeanalyse system boot performance and unit filessystemd-cglsshow the cgroup hierarchysystemd-cgtoptop for cgroups: CPU, memory and I/O per unitsystemd-runrun a command in a transient unit or scope
T
tacconcatenate and print files in reverse (last line first)tailoutput the last part of filestaran archiving utilitytasksetset or retrieve a process's CPU affinitytcpaccept-bpfccTrace TCP acceptstcpconnect-bpfccTrace TCP connectstcpdumpdump traffic on a networktcplife-bpfccTrace the lifespan of TCP sessions and summarizetcpretrans-bpfccTrace TCP retransmitstechdocs-cliBuild, preview and publish Backstage TechDocs sites (@techdocs/cli 1.13)teeread stdin and write to both stdout and filesterraformbuild, change and destroy infrastructure as codetestevaluate an expressiontflinta pluggable linter for Terraform configurationstimeoutrun a command with a time limittopdisplay Linux processestouchchange file timestamps, creating empty files as neededtrtranslate or delete characterstracepathtraces path to a network host discovering MTU along this pathtracerouteprint the route packets trace to network hosttraprun a command when a signal is receivedtreelist contents of directories in a tree-like formattrivya scanner for vulnerabilities in container images, filesystems and git repositories, and misconfigurations in IaCtruedo nothing, successfullytruncateshrink or extend the size of a filetune2fsadjust tunable filesystem parameters on ext2/3/4typedescribe how a command name would be interpreted
U
ufwprogram for managing a netfilter firewallulimitmodify shell resource limitsumaskset the file mode creation maskumountunmount filesystems (util-linux)unaliasremove alias definitionsunameprint system informationuniqreport or omit repeated adjacent linesunsetunset values and attributes of variablesunziplist, test and extract compressed files in a ZIP archiveupdate-ca-certificatesupdate /etc/ssl/certs and ca-certificates.crtuptimetell how long the system has been runninguseraddcreate a new user or update default new user informationuserdeldelete a user account and related filesusermodmodify a user account
V
vacuumdbgarbage-collect and analyze a PostgreSQL databasevalkey-clithe Valkey command line interface (valkey-tools)vaultA tool for securely accessing secrets (HashiCorp Vault 2.2 CLI)vgsdisplay information about LVM volume groupsviVi IMproved, a programmer's text editorvimVi IMproved, a programmer's text editorvmstatReport virtual memory statistics
W
wshow who is logged on and what they are doingwaitwait for a job to completewcprint newline, word and byte counts for each filewgetthe non-interactive network downloaderwhereislocate the binary, source and manual page files for a commandwhichlocate a command in $PATHwhoshow who is logged onwhoamiprint effective user name
X
xargsbuild and execute command lines from standard inputxfs_growfsexpand an XFS filesystem