Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Use this Linux commands cheat sheet to find a command by task, from checking your location to inspecting processes and working with archives. Examples use ordinary shell commands and common Linux utilities, but availability and options vary by distribution and installation. Check the local manual before relying on an option; use extra care with commands that change or remove data.

How to use this Linux commands cheat sheet

The shell interprets what you type. Bash, for example, accepts commands interactively, from standard input, or from a script. Some names are shell built-ins; others run separate programs, so behavior and availability can differ. GNU coreutils provide many everyday file and text utilities, but not every Linux system uses the same implementation or includes the same optional tools.

For a command’s locally supported options, try man command. To search manual-page descriptions, use man -k term. Many GNU utilities also accept command --help, but that pattern is not universal. Replace command and term with the name or subject you need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Navigate and identify your location

  • pwd — print the current working directory.
  • ls — list directory entries. ls -la includes hidden entries and detailed metadata on common implementations.
  • cd — change the current working directory in the shell. In Bash, this is a shell built-in, not a separate executable.

Inspect files

  • cat file.txt — write a file’s contents to standard output; most useful for short files.
  • less file.txt — page through a longer text file if less is installed.
  • head file.txt and tail file.txt — inspect the beginning or end of a file. tail -f file.txt follows appended output on implementations that support it.
  • file path — identify a file type where the utility is installed.
  • stat path — inspect file metadata.

less and file may not be present in minimal installations. Check their manual pages or install documentation for your system if a command is missing.

Create, copy, move, and remove files

  • mkdir new-folder — create a directory.
  • touch notes.txt — create an empty file if it does not exist, or update its timestamps, subject to permissions.
  • cp source.txt copy.txt — copy a file. Copying directories requires an appropriate recursive option; confirm its spelling and behavior locally.
  • mv old-name.txt new-name.txt — move a path or rename it.
  • rm file.txt — remove a directory entry. Deletion is not normally reversible through the command itself; check the path before running it.

These examples use explicit paths and avoid recursive deletion. Be particularly cautious with recursive or elevated-privilege operations, which can affect much more than one file.

Search and transform text

  • grep pattern file.txt — select lines matching a pattern.
  • find path — locate directory entries; consult man find for filters and actions.
  • sort file.txt — sort lines. uniq identifies adjacent repeated lines, so use it after sorting when duplicates may not already be next to one another: sort file.txt | uniq.
  • cut — select fields or character positions from lines.
  • wc file.txt — count lines, words, or bytes; consult man wc for the relevant options.
  • sed and awk — separate text-processing utilities for selecting, transforming, or analyzing text. Their implementations can differ, so check local documentation before relying on nonstandard features.

Manage permissions and ownership

  • chmod — change a file’s mode bits, which govern access permissions.
  • chown and chgrp — change a file’s owner or group, subject to permissions and system policy. Ownership changes often require elevated privileges.
  • umask — view or set the shell’s file-creation permission mask.

Permission changes can grant or remove access. Verify the target path and intended permissions before applying changes, especially when using elevated privileges.

Check processes and system state

  • ps — report process status.
  • top — display ongoing process activity where installed.
  • kill — send a signal to a process. Sending a signal does not guarantee that the process terminates immediately.
  • uname — report system information such as the kernel name or machine architecture.
  • df — report filesystem space; du — estimate space used by files or directories.
  • free — report memory information where installed.

These are common Linux administration commands, not a guarantee that every minimal environment includes every utility.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect networking and connections

  • ip — inspect or configure network interfaces and routes on systems using iproute2.
  • ping — test reachability using ICMP where permitted.
  • ss — inspect sockets on systems with iproute2.
  • curl or wget — transfer data from URLs when installed.
  • ssh — connect to a remote system when the client is installed and access is configured.

A command’s presence does not ensure a connection will work: permissions, firewall rules, network policy, and remote configuration all matter. Look up the installed tool’s manual or help output before using flags for network configuration or transfers.

Work with archives and compression

  • tar — create or extract archives. Compression may be handled by an option or an external compressor, depending on the command and build.
  • gzip and xz — compress or decompress data in their supported formats.
  • zip and unzip — create or extract ZIP archives where installed.

An archive groups files; compression reduces data size. These operations are related but distinct, and implementation-specific options should be verified with local help.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Identify commands and get local help

  • man command — open the local manual page for a command.
  • man -k term — search manual-page descriptions for a term.
  • command --help — try the common GNU utility help pattern; not every command supports it.
  • type name or command -v name — ask the current shell how it resolves a name. Shell behavior can vary.

When a command or option matters, use the documentation installed on the target machine: it reflects the utility and version available there more closely than a generic cheat sheet.

Portability and safety checks

  • Mark Bash-specific syntax as Bash when sharing commands or scripts. Bash has POSIX-related behavior, but its default mode also includes Bash-specific features; check the target shell when portability matters.
  • Package managers and service-management commands are distribution- or implementation-specific. Do not assume one command works across all Linux systems; consult the documentation for the target distribution and service manager.
  • Confirm version-sensitive flags using man command or the installed command’s help.
  • Review paths and consequences before commands that delete data, overwrite files, change permissions, or run with elevated privileges.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.