Operations 40 min read

Comprehensive A‑Z Linux Command Cheat Sheet (2023)

This article presents an alphabetical reference of Linux commands from A to Z, offering concise descriptions for each utility to help users quickly look up command purposes, syntax hints, and typical use cases.

Linux Tech Enthusiast
Linux Tech Enthusiast
Linux Tech Enthusiast
Comprehensive A‑Z Linux Command Cheat Sheet (2023)

A

access : Checks whether a program can access a specified file, useful for testing file existence.

accton : Starts or stops the accounting process or changes the accounting file.

aclocal : Generates aclocal.m4 automatically from configure.in.

acpi : Displays battery status and other ACPI information.

acpi_available : Tests whether the ACPI subsystem is available.

acpid : Provides intelligent power management by notifying user‑space programs of ACPI events.

addr2line : Converts an address to the corresponding file name and line number.

agetty : Manages physical or virtual terminals for multi‑user access.

alias : Replaces one string with another when a shell executes a command.

amixer : Command‑line mixer for ALSA sound drivers.

aplay : Command‑line audio player for ALSA.

aplaymidi : Plays standard MIDI files via ALSA MIDI ports.

apropos : Helps users find commands when they only remember keywords.

apt : High‑level CLI for package management, intended for end users.

apt-get : Command‑line tool for handling packages.

aptitude : Provides a rich interface for interacting with the package manager.

ar : Creates, modifies, and extracts files from archives.

arch : Prints the machine architecture.

arp : Manipulates the ARP cache, allowing full dumps.

aspell : Spell‑checking utility for Linux.

atd : Daemon that schedules jobs for later execution.

atrm : Removes a specified job by its job number.

atq : Lists pending jobs scheduled by at.

autoconf : Generates configuration scripts.

autoheader : Creates template header files for configure.

automake : Generates Makefile.in files following GNU standards.

autoreconf : Creates automatically buildable source code for Unix‑like systems.

autoupdate : Updates configure.in to newer Autoconf versions.

awk : Scripting language for data manipulation and report generation.

B

banner : Prints a large ASCII string to standard output.

basename : Strips directory components and suffixes, printing the file name.

batch : Reads commands from stdin or a file and executes them when the average load is below 1.5.

bc : Command‑line calculator.

bg : Moves a foreground job to the background.

biff : Mail notification system that alerts users of new mail.

bind : Sets Readline key bindings and variables.

bison : Parser generator similar to yacc.

break : Terminates for, while, or until loops.

builtin : Runs a shell builtin with arguments and returns its exit status.

bzcmp : Calls cmp on bzip2 compressed files.

bzdiff : Compares bzip2 compressed files.

bzgrep : Searches patterns inside bzip2 compressed files.

bzip2 : Compresses and decompresses files.

bzless : Views bzip2 files without reading the entire input first.

bzmore : Filters bzip2 files for CRT viewing.

C

cal : Shows a calendar for a specific month or year; defaults to the current month.

case : Preferred when multiple if/elif branches are needed on a single variable.

cat : Reads data from files and outputs their contents.

cc : Compiles C source code into an executable.

ccrypt : Command‑line tool for encrypting and decrypting data.

cd : Changes the current working directory.

cfdisk : Text‑based graphical interface for displaying or editing partition tables.

chage : Views and modifies user password expiration information.

chattr : Changes file attributes on a filesystem.

chfn : Modifies a user's full name and other details.

chgrp : Changes group ownership of files or directories.

chkconfig : Lists all available services and views or updates their run‑level settings.

chmod : Changes file access modes.

chown : Changes file owner or group.

chpasswd : Changes passwords for multiple users at once.

chroot : Changes the root directory for a process.

chrt : Manipulates real‑time attributes of processes.

chsh : Changes a user's login shell.

chvt : Switches between available TTY terminals.

cksum : Displays a CRC value, byte count, and file name.

clear : Clears the terminal screen.

cmp : Compares two files byte‑by‑byte to determine if they are identical.

col : Filters reverse line feeds; reads from stdin and writes to stdout.

colcrt : Formats text‑processor output for CRT displays.

colrm : Deletes selected columns from a file.

column : Displays file contents in columns.

comm : Compares two sorted files line‑by‑line, showing common and unique lines.

compress : Reduces file size, adding a .Z extension.

continue : Skips the current iteration of for, while, or until loops.

cp : Copies files, groups of files, or directories.

cpio : Handles archive files like *.cpio or *.tar, copying files to or from an archive.

cpp : Preprocesses source code before compilation.

cron : Schedules tasks to run automatically at specified times.

crontab : Lists scheduled tasks.

csplit : Splits a file into multiple parts based on user criteria.

ctags : Quickly accesses definitions such as function locations.

cupsd : Scheduler for CUPS, implementing Internet Printing Protocol.

curl : Transfers data to or from a server using any supported protocol.

cut : Extracts sections from each line of a file.

cvs : Stores file history and can revert to previous versions.

D

date : Displays or sets the system date and time.

dc : Evaluates arithmetic expressions in postfix notation.

dd : Converts and copies files, often used for low‑level data copying.

declare : Declares shell variables and functions, setting attributes and displaying values.

depmod : Generates dependency descriptions for kernel modules.

df : Shows total and available space information for filesystems.

diff : Displays line‑by‑line differences between files.

diff3 : Compares three files line‑by‑line.

dir : Lists directory contents.

dirname : Removes trailing slashes from a path, printing the remaining part.

dirs : Shows the list of remembered directories.

disable : Stops a printer or class.

dmesg : Checks the kernel ring buffer and prints kernel messages.

dmidecode : Retrieves hardware information such as CPU, RAM, and BIOS details.

domainname : Returns the NIS domain name of the host.

dos2unix : Converts DOS text files to UNIX format.

dosfsck : Diagnoses and attempts to fix MS‑DOS filesystem issues.

dstat : Retrieves statistics from system components like network, I/O devices, or CPU.

du : Tracks files and directories that consume excessive disk space.

dump : Backs up a filesystem to a storage device.

dumpe2fs : Prints superblock and block group information of a filesystem.

dumpkeys : Dumps the keyboard translation table.

E

echo : Displays the text/string passed as arguments.

ed : Line‑oriented text editor with a minimal interface.

egrep : Treats patterns as extended regular expressions and prints matching lines.

eject : Ejects removable media such as CD‑ROMs or floppy disks.

emacs : Simple‑interface editor without an insert mode.

enable : Starts a printer or class.

env : Prints environment variables or runs utilities in a custom environment.

eval : Executes arguments as a shell command.

ex : Line‑editing mode of the vi editor.

exec : Executes a command from within bash.

exit : Exits the current running shell.

expa : Converts tabs to spaces; reads from stdin if no file is specified.

expect : Automates interactive scripts that require user input.

export : Marks variables for export to child processes.

expr : Evaluates a given expression and displays the result.

F

factor : Prints prime factors of a given number.

fc : Lists, edits, or re‑executes previously entered shell commands.

fc-cache : Scans font directories and builds a cache for fontconfig‑using applications.

fc-list : Lists available fonts and styles, with filtering options.

fdisk : Dialog‑driven command for creating and manipulating disk partition tables.

fg : Brings a background job to the foreground.

fgrep : Searches for fixed strings in files.

file : Determines file type, reporting human‑readable or MIME types.

find : Searches for files and directories and performs subsequent actions.

finger : Provides detailed information about logged‑in users.

fmt : Formats text files for simplification and optimization.

fold : Wraps each line of input to a specified width.

for : Repeats a set of commands for each element in a list.

free : Shows total and used memory, swap, and kernel buffers.

Fun : Draws various patterns on the terminal.

function : Creates a function or method.

G

g++ : Preprocesses, compiles, assembles, and links source code to produce executables.

gawk : Pattern scanning and processing language.

gcc : GNU Compiler Collection for compiling C, C++, Objective‑C, etc.

gdb : GNU Debugger for programs written in C, C++, Ada, Fortran, and more.

getent : Retrieves entries from various system databases.

gpasswd : Manages /etc/group and /etc/gshadow.

grep : Searches files for a specific character pattern and prints matching lines.

groupadd : Creates a new user group.

groupdel : Deletes an existing group.

groupmod : Modifies an existing group.

groups : Lists groups a user belongs to.

grpck : Verifies integrity of group information.

grpconv : Converts to shadow groups.

gs : Calls Ghostscript, an interpreter for PostScript and PDF.

gunzip : Compresses or expands files.

gzexe : Compresses executable files and auto‑decompresses on execution.

gzip : Compresses files, creating a .gz file.

H

halt : Signals hardware to stop all CPU functions, leading to reboot or shutdown.

hash : Maintains a hash table of recently executed programs.

hdparm : Retrieves and modifies hard‑disk statistics, write‑cache, acoustic management, and DMA settings.

head : Prints the first N lines of input.

help : Shows information about shell built‑in commands.

hexdump : Filters and displays files or stdin in a human‑readable format.

history : Shows previously executed commands.

host : Performs DNS lookup operations.

hostid : Displays the host ID in hexadecimal.

hostname : Retrieves or sets the system's DNS or NIS domain name.

hostnamectl : Provides API to control and change the host name.

htop : Interactive real‑time system resource monitor.

hwclock : Accesses the hardware (real‑time) clock.

I

iconv : Converts text from one encoding to another.

id : Shows user and group IDs for the current or specified user.

if : Executes commands based on a condition.

ifconfig : Configures kernel‑resident network interfaces.

iftop : Network analysis tool for bandwidth statistics.

ifup : Activates a network interface.

import : Captures a screenshot of any active page and saves it as an image file.

info : Reads documentation in the info format, providing detailed command information.

insmod : Inserts a module into the kernel.

install : Copies files and sets attributes.

iostat : Monitors I/O statistics for devices and partitions.

iotop : Shows detailed disk I/O usage per process.

ip : Performs various network management tasks.

ipcrm : Removes IPC resources, cleaning up associated data structures.

ipcs : Displays information about IPC facilities the calling process can read.

iptables : Configures and maintains IPv4 Netfilter firewall tables.

iptables-save : Saves current iptables rules to a file.

iwconfig : Shows wireless parameters and statistics from /proc/net/wireless.

J

join : Joins lines of two files based on a common field.

journalctl : Views systemd, kernel, and journal logs.

K

kill : Sends signals to terminate processes.

L

last : Shows a list of all users who have logged in and out since the /var/log/wtmp file was created.

less : Views text files one screen at a time.

let : Evaluates arithmetic expressions for shell variables.

ln : Creates links between files.

locate : Finds files by name.

look : Displays lines that start with a given string.

lsblk : Shows detailed information about block devices.

lshw : Generates detailed hardware configuration information from /proc files.

lsmod : Shows the status of kernel modules.

lsof : Lists open files.

lsusb : Shows information about USB buses and connected devices.

M

mailq : Prints the mail queue.

man : Displays the manual page for any command.

md5sum : Verifies data integrity using MD5.

mkdir : Creates directories, allowing multiple at once.

modinfo : Shows information about a kernel module.

more : Views text files one screen at a time, useful for large files.

mount : Mounts a filesystem to the directory tree.

mpstat : Reports processor‑related statistics.

mv : Moves or renames files or directories.

N

nc (netcat) : Powerful network, security, or monitoring tool.

netstat : Shows network connections, routing tables, interface statistics, and more.

nmcli : Controls NetworkManager; can display device status, create, edit, activate/deactivate, and delete connections.

nslookup : Queries DNS for domain name or IP address mappings.

O

od : Converts input to various formats, defaulting to octal.

P

passwd : Changes a user account password.

paste : Horizontally merges files, separating columns with tabs.

pidof : Finds the process ID of a running program.

ping : Checks network connectivity between hosts.

pinky : Provides detailed information about logged‑in users.

pmap : Shows a process's memory map.

poweroff : Sends an ACPI signal to shut down the system.

printf : Displays formatted strings, numbers, or other data on the terminal.

ps : Lists currently running processes and their PIDs.

pwd : Prints the current working directory path.

R

ranlib : Generates an index to an archive.

rcp : Copies files between computers.

read : Reads a specified number of bytes from a file descriptor into a buffer.

readelf : Retrieves information from ELF files.

readlink : Prints the resolved symbolic link or canonical filename.

reboot : Reboots the system.

rename : Renames files using a Perl expression.

reset : Reinitializes the terminal.

restore : Restores files from a backup created with dump.

return : Exits a shell function.

rev : Reverses characters in each line.

rm : Removes files, directories, symbolic links, etc.

rmdir : Removes empty directories.

rmmod : Removes a module from the kernel.

route : Manages IP/kernel routing tables.

rsync : Synchronizes files and directories between two hosts.

S

sar : Monitors system resources such as CPU, memory, and I/O usage.

scp : Securely copies files between servers.

screen : Allows multiple shell sessions from a single SSH connection.

script : Records all terminal activity.

scriptreplay : Replays a recorded script log.

sdiff : Compares two files and writes results side‑by‑side.

sed : Finds, filters, replaces, and manipulates text.

select : Creates a numbered menu for user selection.

seq : Generates numbers from FIRST to LAST in INCREMENT steps.

setsid : Runs a program in a new session.

shift : Moves command‑line arguments left by one position.

showkey : Prints scan codes or ASCII codes for each key press.

shred : Securely deletes files from a hard drive.

shutdown : Safely shuts down the system.

sleep : Delays execution, creating a virtual job.

source : Reads and executes a file's contents in the current shell.

sort : Sorts file records in a specified order.

split : Splits a large file into smaller pieces.

ssh : Securely connects to a remote server or system.

strace : Powerful process monitoring and diagnostic tool.

stty : Changes and prints terminal line settings.

sudo : Prefix for commands that require super‑user privileges.

sum : Calculates checksums and block counts in files.

sync : Flushes caches to persistent storage.

systemctl : Checks and controls the systemd service manager.

T

tac : Concatenates and prints files in reverse order.

tail : Prints the last N lines of input.

tar : Creates or extracts archive files.

tee : Reads stdin and writes to stdout and one or more files.

time : Executes a command and prints real, user, and system CPU time.

top : Provides a dynamic real‑time view of system processes.

touch : Creates or modifies file timestamps.

tr : Translates or deletes characters.

tracepath : Traces the path to a destination, revealing MTU.

traceroute : Prints the route packets take to a host.

tree : Recursively lists directories with indentation.

tty : Displays information about the terminal.

type : Describes how a command name would be interpreted.

U

uname : Shows system information.

unexpand : Converts spaces to tabs.

uniq : Reports or filters duplicate lines in a file.

unix2dos : Converts Unix text files to DOS format.

until : Executes commands until a condition becomes true.

uptime : Shows how long the system has been running.

useradd : Adds a user account.

usermod : Modifies user attributes.

username : Retrieves the username and its configuration.

users : Shows usernames of currently logged‑in users.

userdel : Deletes a user account and related files.

V

vi : Default visual editor on Unix systems.

vmstat : Monitors performance metrics such as processes, memory, paging, block I/O, and CPU scheduling.

vnstat : Monitors network parameters like bandwidth consumption.

W

w : Shows who is logged in and what they are doing.

wall : Sends a message to all logged‑in users' terminals.

watch : Periodically executes a program, displaying full‑screen output.

wc : Counts lines, words, bytes, and characters in files.

wget : Downloads files from a server, can run in the background.

whatis : Retrieves a one‑line description from a manual page.

which : Locates the executable associated with a command by searching the PATH.

while : Repeats a set of commands as long as a condition remains true.

who : Shows information about currently logged‑in users.

whoami : Displays the current user's username.

write : Sends a line of text from one user's terminal to another's.

X

xargs : Builds and executes commands from standard input, converting input into arguments.

xdg-open : Opens a file or URL with the user's preferred application.

Y

yes : Prints a continuous stream of a given string; defaults to "y" if no string is provided.

Z

zdiff : Calls diff on gzip‑compressed files.

zdump : Prints the current time in specified time zones.

zgrep : Searches for expressions in compressed files.

zip : Compresses and packages files into a .zip archive.

LinuxUtilities
Linux Tech Enthusiast
Written by

Linux Tech Enthusiast

Focused on sharing practical Linux technology content, covering Linux fundamentals, applications, tools, as well as databases, operating systems, network security, and other technical knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.