Command reference
Linux commands explained clearly, with examples and safety notes.
Browse by task area or search directly. Each command page explains what the command does, how its arguments work, common examples, beginner notes, and related tools.
Library
165 essential Linux commands grouped by practical work.
This is not a tiny cheat sheet. It is a structured command library for reading, reference, and safe everyday use.
Most Useful Commands for Beginners
A practical starter set for moving around, reading files, installing software, checking identity, and asking for help.
Most Useful Commands for Servers
Commands for service state, logs, networking, packages, users, disk space, and remote administration.
Most Useful Commands for Troubleshooting
Inspection-first commands for narrowing problems without changing the system too early.
Must-Know Commands for Every Linux User
The durable command vocabulary that appears across desktops, servers, rescue systems, and documentation.
File and Folder Operations
Create, copy, move, rename, and remove filesystem objects.
mkdir
Creates directories.
mkdir [options] directory...
touch
Creates empty files or updates timestamps.
touch [options] file...
cp
Copies files and directories.
cp [options] source... destination
mv
Moves or renames files and directories.
mv [options] source... destination
rm
Removes files or directory trees.
rm [options] file...
rmdir
Removes empty directories.
rmdir [options] directory...
stat
Shows detailed file metadata.
stat [options] file...
file
Identifies a file's type from its contents.
file [options] file...
Viewing Content
Read files safely from the terminal without opening a full editor.
cat
Prints and concatenates file contents.
cat [options] file...
less
Opens text in a scrollable pager.
less [options] file
more
Displays text page by page.
more [options] file
head
Shows the first lines of a file or stream.
head [options] [file]
tail
Shows the last lines of a file or follows new output.
tail [options] [file]
tac
Prints files in reverse line order.
tac [file...]
nl
Numbers lines of text.
nl [options] [file]
wc
Counts lines, words, bytes, or characters.
wc [options] [file...]
od
Dumps file bytes in octal, hex, or other formats.
od [options] [file]
Search and Filtering
Find files, commands, and text patterns across a system.
grep
Searches text for matching patterns.
grep [options] pattern [file...]
find
Searches for files by name, type, time, size, and more.
find path [tests] [actions]
locate
Finds files quickly from a filename database.
locate [options] pattern
which
Shows the executable path that would run for a command.
which command
whereis
Locates binaries, source, and manual files.
whereis [options] name
egrep
Searches with extended regular expressions.
egrep pattern [file...]
fgrep
Searches fixed strings instead of regular expressions.
fgrep pattern [file...]
Permissions and Ownership
Inspect and change who can read, write, and execute files.
chmod
Changes file mode permissions.
chmod [options] mode file...
chown
Changes file owner and optionally group.
chown [options] owner[:group] file...
chgrp
Changes group ownership.
chgrp [options] group file...
sudo
Runs a command with elevated privileges according to policy.
sudo [options] command
umask
Shows or sets default permission filtering.
umask [mode]
su
Switches user or starts a shell as another user.
su [options] [user]
Processes
List, prioritize, and signal running programs.
ps
Reports current processes.
ps [options]
top
Shows live process and resource usage.
top [options]
htop
Provides an interactive process viewer.
htop
kill
Sends a signal to a process.
kill [signal] PID...
pkill
Sends signals to processes matched by name or attributes.
pkill [options] pattern
nice
Starts a command with adjusted scheduling priority.
nice [-n adjustment] command [args...]
renice
Changes priority of an already running process.
renice priority [-p PID] [-u user]
killall
Signals processes by exact command name.
killall [options] name
pgrep
Finds process IDs by pattern.
pgrep [options] pattern
Services and System Control
Control systemd services and inspect the system journal.
systemctl
Controls systemd services and system state.
systemctl [command] [unit]
service
Controls services through legacy init wrappers.
service name action
chkconfig
Manages legacy SysV service startup settings.
chkconfig [options] service
hostnamectl
Views and changes system hostname metadata.
hostnamectl [command]
timedatectl
Views and changes time, timezone, and NTP settings.
timedatectl [command]
loginctl
Inspects logins, sessions, and seats.
loginctl [command]
localectl
Views and changes locale and keyboard settings.
localectl [command]
ulimit
Shows or changes shell resource limits.
ulimit [options] [limit]
Package Management
Install, remove, query, and verify software packages.
apt
Manages packages on Debian and Ubuntu-style systems.
apt [command] [package]
apt-get
Script-friendly Debian package management tool.
apt-get [command] [package]
dnf
Manages packages on Fedora and modern RPM systems.
dnf [command] [package]
yum
Older RPM package manager still seen in enterprise documentation.
yum [command] [package]
pacman
Manages packages on Arch Linux and related systems.
pacman [operation] [options] [package]
zypper
Manages packages on openSUSE and SUSE systems.
zypper [command] [package]
apk
Manages packages on Alpine Linux.
apk [command] [package]
rpm
Queries and manipulates RPM package files and database entries.
rpm [options] [package-or-file]
dpkg
Queries and manipulates Debian package files and database entries.
dpkg [options] [package-or-file]
apt-cache
Queries apt package metadata.
apt-cache [command] [package]
snap
Manages Snap packages.
snap [command] [package]
flatpak
Manages Flatpak desktop applications.
flatpak [command] [app-id]
Networking
Test connectivity, inspect sockets, and transfer data.
ping
Tests basic network reachability with ICMP echo requests.
ping [options] host
ip
Shows and configures networking state.
ip [object] [command]
ss
Inspects sockets and listening ports.
ss [options]
curl
Transfers data with URLs.
curl [options] URL
wget
Downloads files from the web.
wget [options] URL
netstat
Displays network connections and routing information.
netstat [options]
dig
Queries DNS records.
dig [options] name [type]
nslookup
Performs basic DNS lookups.
nslookup name [server]
traceroute
Shows the network path toward a host.
traceroute host
mtr
Combines ping and traceroute in a live view.
mtr [options] host
hostname
Shows or sets the system hostname.
hostname [name]
nmcli
Controls NetworkManager from the command line.
nmcli [object] [command]
ifconfig
Shows or configures network interfaces on older systems.
ifconfig [interface]
System Information
Identify users, kernels, disks, and system state.
uname
Prints kernel and machine information.
uname [options]
whoami
Prints the current effective username.
whoami
id
Shows user and group IDs.
id [user]
lscpu
Displays CPU architecture information.
lscpu
free
Shows memory usage.
free [options]
vmstat
Reports virtual memory and system activity.
vmstat [delay [count]]
iostat
Reports CPU and block device I/O statistics.
iostat [options] [interval] [count]
uptime
Shows how long the system has been running.
uptime
Disk and Storage
Inspect disks, partitions, usage, and mount points.
df
Shows filesystem disk space usage.
df [options] [path]
du
Estimates file and directory space usage.
du [options] [path]
mount
Attaches a filesystem to the directory tree.
mount [options] source target
umount
Detaches a mounted filesystem.
umount [options] target
blkid
Shows block device identifiers and filesystem metadata.
blkid [device]
lsblk
Lists block devices in a tree.
lsblk [options]
fdisk
Views and edits partition tables.
fdisk [options] device
parted
Creates and edits partition tables, including GPT.
parted [options] device [command]
mkfs
Creates a filesystem on a device.
mkfs -t type device
fsck
Checks and repairs filesystems.
fsck [options] device
swapon
Enables swap devices or files.
swapon [options] device-or-file
swapoff
Disables swap devices or files.
swapoff device-or-file
dd
Copies bytes between files or devices.
dd if=input of=output [options]
badblocks
Tests block devices for bad blocks.
badblocks [options] device
Compression and Archives
Package and unpack files with common archive formats.
tar
Creates and extracts archive files.
tar [options] archive [files...]
gzip
Compresses files using gzip.
gzip [options] file...
gunzip
Decompresses gzip files.
gunzip [options] file.gz...
zip
Creates ZIP archives.
zip [options] archive.zip files...
unzip
Extracts or lists ZIP archives.
unzip [options] archive.zip
bzip2
Compresses files using bzip2.
bzip2 [options] file...
bunzip2
Decompresses bzip2 files.
bunzip2 [options] file.bz2
xz
Compresses or decompresses xz files.
xz [options] file...
cpio
Copies files into or out of cpio archives.
cpio [options]
Text Processing
Transform streams and files with composable terminal tools.
sed
Edits text streams with scripted rules.
sed [options] script [file...]
awk
Processes structured text by fields and patterns.
awk 'pattern { action }' [file...]
sort
Sorts lines of text.
sort [options] [file...]
cut
Extracts sections from each line.
cut [options] [file...]
tr
Translates or deletes characters in a stream.
tr [options] set1 [set2]
xargs
Builds command arguments from input.
xargs [options] command
uniq
Removes or reports adjacent duplicate lines.
uniq [options] [input [output]]
tee
Writes input to both a file and standard output.
tee [options] file...
paste
Merges lines from files side by side.
paste [options] file1 file2
join
Joins sorted files on a common field.
join [options] file1 file2
comm
Compares two sorted files line by line.
comm [options] file1 file2
split
Splits a file into pieces.
split [options] file [prefix]
fmt
Reformats paragraphs of text.
fmt [options] [file]
column
Formats text into aligned columns or tables.
column [options] [file]
User and Group Management
Manage accounts, passwords, groups, and identities.
passwd
Changes user passwords and password state.
passwd [options] [user]
useradd
Creates user accounts.
useradd [options] username
usermod
Modifies existing user accounts.
usermod [options] username
userdel
Deletes user accounts.
userdel [options] username
groupadd
Creates groups.
groupadd [options] group
groups
Shows group memberships.
groups [user]
groupmod
Modifies a group.
groupmod [options] group
groupdel
Deletes a group.
groupdel group
Shell and Environment
Work with variables, history, aliases, and help systems.
echo
Prints text or variable values.
echo [text...]
export
Marks shell variables for child processes.
export NAME=value
env
Prints or runs commands with an environment.
env [NAME=value...] [command]
alias
Creates shell command shortcuts.
alias name='command'
history
Shows previous shell commands.
history [number]
man
Opens manual pages.
man [section] page
apropos
Searches manual page descriptions.
apropos keyword
clear
Clears the terminal display.
clear
printenv
Prints environment variables.
printenv [variable]
source
Runs a script in the current shell.
source file
.
POSIX shorthand for source.
. file
exit
Exits a shell or script.
exit [status]
pipe
Sends output from one command into another.
command1 | command2
redirection
Reads or writes command streams to files.
command > file command >> file command 2> errors.log
Logs and Diagnostics
Read logs and diagnose running systems.
Jobs and Background Execution
Run commands in the background and schedule recurring work.
jobs
Lists jobs started from the current shell.
jobs [options]
bg
Resumes a stopped shell job in the background.
bg [%job]
fg
Brings a shell job to the foreground.
fg [%job]
nohup
Runs a command immune to terminal hangup.
nohup command [args...] &
cron
Runs scheduled jobs through a background daemon.
cron
crontab
Edits per-user cron schedules.
crontab [options]
disown
Removes jobs from shell job control.
disown [%job]
at
Schedules a one-time command.
at time
Editors
Open and edit files from terminal environments.
Remote Access
Connect to, copy from, and synchronize with remote systems.