Linux Commands List (193+ Commands with Examples)
Complete reference for Linux commands. Each command includes syntax, options, practical examples with output, and pro tips from experienced sysadmins.
File Management (8 commands)
cd
Beginner
Change the current working directory
cp
Beginner
Copy files and directories
ln
Intermediate
Create hard and symbolic links between files
ls
Beginner
List directory contents and file information
mkdir
Beginner
Create new directories
mv
Beginner
Move or rename files and directories
rm
Beginner
Remove files and directories permanently
touch
Beginner
Create empty files or update file timestamps
Text Processing (23 commands)
awk
Advanced
Pattern scanning and text processing language
cat
Beginner
Concatenate and display file contents
cmp
Beginner
Compare two files byte by byte
column
Beginner
Format text into columns for clean output
comm
Intermediate
Compare two sorted files line by line
cut
Beginner
Remove sections from each line of files
diff
Intermediate
Compare files line by line
grep
Beginner
Search text using patterns (regular expressions)
head
Beginner
Output the first part of files
less
Beginner
View file contents with scrolling and search
more
Beginner
View file contents one screen at a time
nl
Beginner
Number lines of files
paste
Intermediate
Merge lines of files side by side
rev
Beginner
Reverse characters in each line of a file
sed
Intermediate
Stream editor for filtering and transforming text
sort
Beginner
Sort lines of text files
tac
Beginner
Concatenate and print files in reverse (last line first)
tail
Beginner
Output the last part of files
tee
Intermediate
Read from stdin and write to stdout and files
tr
Intermediate
Translate or delete characters
uniq
Beginner
Report or filter out repeated lines
wc
Beginner
Print newline, word, and byte counts for files
xargs
Intermediate
Build and execute command lines from standard input
File Viewing & Searching (7 commands)
file
Beginner
Determine the type of a file
find
Intermediate
Search for files and directories in a directory hierarchy
locate
Beginner
Find files by name using a pre-built database
stat
Intermediate
Display detailed file or filesystem status
tree
Beginner
List directory contents in a tree-like format
whereis
Beginner
Locate the binary, source, and manual page files for a command
which
Beginner
Show the full path of shell commands
Permissions & Ownership (6 commands)
chgrp
Beginner
Change group ownership of files
chmod
Beginner
Change file and directory permissions
chown
Beginner
Change file owner and group
getfacl
Advanced
Get file access control lists
setfacl
Advanced
Set file access control lists for fine-grained permissions
umask
Intermediate
Set default file creation permissions
User Management (15 commands)
adduser
Beginner
Add a user to the system (interactive, Debian-based)
chage
Intermediate
Change user password expiry information
groupadd
Intermediate
Create a new group
groups
Beginner
Print group memberships for a user
id
Beginner
Print user and group IDs
last
Intermediate
Show listing of last logged in users
passwd
Beginner
Change user password
su
Beginner
Switch user or become superuser
sudo
Beginner
Execute a command as another user (typically root)
useradd
Intermediate
Create a new user account
userdel
Intermediate
Delete a user account
usermod
Intermediate
Modify a user account
visudo
Intermediate
Safely edit the sudoers file
w
Beginner
Show who is logged in and what they are doing
whoami
Beginner
Print the current username
Process Management (16 commands)
bg
Intermediate
Resume a suspended job in the background
fg
Intermediate
Bring a background job to the foreground
htop
Beginner
Interactive process viewer with color and mouse support
jobs
Intermediate
Display status of background jobs in current shell
kill
Beginner
Send signals to processes (terminate, stop, continue)
killall
Beginner
Kill processes by name
nice
Intermediate
Run a command with modified scheduling priority
nohup
Intermediate
Run a command immune to hangups (keeps running after logout)
pgrep
Intermediate
Look up processes based on name and attributes
pkill
Intermediate
Send signals to processes based on name and attributes
ps
Beginner
Report a snapshot of current running processes
pstree
Beginner
Display processes as a tree showing parent-child relationships
renice
Intermediate
Alter priority of running processes
screen
Intermediate
Terminal multiplexer for persistent sessions
tmux
Intermediate
Terminal multiplexer with session management
top
Beginner
Display real-time system resource usage and processes
System Information (15 commands)
arch
Beginner
Print machine hardware architecture
cal
Beginner
Display a calendar in the terminal
chroot
Advanced
Run command or shell with a different root directory
date
Beginner
Display or set the system date and time
dmesg
Intermediate
Print kernel ring buffer messages
free
Beginner
Display amount of free and used memory
hostname
Beginner
Show or set the system hostname
lsblk
Beginner
List information about block devices (disks)
lscpu
Beginner
Display CPU architecture information
lshw
Intermediate
List detailed hardware configuration
lspci
Intermediate
List all PCI devices
lsusb
Intermediate
List USB devices
nproc
Beginner
Print the number of processing units available
uname
Beginner
Print system information (kernel, OS, architecture)
uptime
Beginner
Show how long the system has been running
Disk & Storage (10 commands)
blkid
Intermediate
Locate/print block device attributes
dd
Advanced
Convert and copy data at block level
df
Beginner
Report filesystem disk space usage
du
Beginner
Estimate file and directory space usage
fdisk
Advanced
Partition table manipulator for Linux
fsck
Advanced
Check and repair a Linux filesystem
mkfs
Advanced
Build a filesystem on a device partition
mount
Intermediate
Mount a filesystem
ncdu
Beginner
Interactive disk usage analyzer with ncurses interface
umount
Intermediate
Unmount a filesystem
Networking (19 commands)
arp
Intermediate
Manipulate the ARP cache
curl
Beginner
Transfer data from or to a server using various protocols
dig
Intermediate
DNS lookup utility for querying name servers
ethtool
Advanced
Display or change ethernet device settings
host
Beginner
DNS lookup utility (simple)
ifconfig
Beginner
Configure or display network interface parameters (legacy)
ip
Intermediate
Show and manipulate network interfaces, routing, and tunnels
ip route
Intermediate
Show and manipulate the routing table
mtr
Intermediate
Combine ping and traceroute in a single network diagnostic tool
nc
Advanced
Networking utility for reading/writing across network connections
netstat
Intermediate
Print network connections, routing tables, and stats (legacy)
nmap
Advanced
Network exploration tool and security scanner
nslookup
Beginner
Query DNS name servers interactively
ping
Beginner
Send ICMP echo requests to test network connectivity
ss
Intermediate
Show socket statistics (modern replacement for netstat)
ss -tulnp
Intermediate
Show listening TCP/UDP ports with process info
tcpdump
Advanced
Capture and analyze network traffic
traceroute
Intermediate
Trace the route packets take to a network host
wget
Beginner
Download files from the web (HTTP, HTTPS, FTP)
SSH & Remote (6 commands)
rsync
Intermediate
Fast and versatile file synchronization tool
scp
Beginner
Securely copy files between hosts over SSH
sftp
Intermediate
Secure File Transfer Protocol (interactive)
ssh
Beginner
Securely connect to remote servers
ssh-copy-id
Intermediate
Install your SSH public key on a remote server
ssh-keygen
Intermediate
Generate SSH key pairs for authentication
Package Management (9 commands)
apt
Beginner
Package manager for Debian-based distributions
apt-get
Beginner
Low-level package handling for Debian systems
dnf
Beginner
Package manager for RPM-based distributions (Fedora, RHEL 8+)
dpkg
Intermediate
Debian package manager for .deb files
flatpak
Beginner
Install and manage Flatpak applications
pip
Beginner
Install Python packages from PyPI
rpm
Intermediate
RPM Package Manager for .rpm files
snap
Beginner
Install and manage snap packages
yum
Beginner
Package manager for older RPM-based systems (legacy)
Systemd & Services (7 commands)
hostnamectl
Beginner
Control system hostname
journalctl
Beginner
Query and display systemd journal logs
loginctl
Intermediate
Control the systemd login manager
service
Beginner
Run a System V init script (legacy service management)
systemctl
Beginner
Control the systemd system and service manager
systemd-analyze
Intermediate
Analyze system boot-up performance
timedatectl
Beginner
Control system time and date settings
Compression & Archives (8 commands)
bzip2
Beginner
Compress files using Burrows-Wheeler block sorting
gunzip
Beginner
Decompress .gz files
gzip
Beginner
Compress files using Lempel-Ziv coding
tar
Beginner
Archive files using tape archive format
unzip
Beginner
Extract files from ZIP archives
xz
Intermediate
Compress files using LZMA2 algorithm (best compression)
zcat
Beginner
View contents of compressed files without decompressing
zip
Beginner
Package and compress files into ZIP archives
Shell Scripting (18 commands)
alias
Beginner
Create command shortcuts
basename
Beginner
Strip directory and suffix from filenames
dirname
Beginner
Strip last component from a file path
echo
Beginner
Display a line of text to the terminal
env
Beginner
Display or set environment variables
export
Beginner
Set environment variables for child processes
expr
Intermediate
Evaluate expressions (arithmetic, string, comparison)
history
Beginner
Display or manipulate command history
printenv
Beginner
Print all or specific environment variables
printf
Intermediate
Format and print data with precise control
read
Intermediate
Read a line of input from standard input
seq
Beginner
Print a sequence of numbers
sleep
Beginner
Delay for a specified amount of time
source
Beginner
Execute commands from a file in the current shell
test
Intermediate
Evaluate conditional expressions for scripting
type
Beginner
Show how a command name is interpreted by the shell
wait
Intermediate
Wait for background processes to finish
yes
Beginner
Output a string repeatedly until killed
Logging & Monitoring (5 commands)
at
Intermediate
Schedule a one-time command to run at a specific time
crontab
Intermediate
Schedule recurring tasks with cron
logger
Intermediate
Send messages to the system log
logrotate
Intermediate
Rotate, compress, and manage log files
watch
Beginner
Execute a program periodically and show output
Firewall & Security (11 commands)
certbot
Intermediate
Lets Encrypt client for obtaining SSL/TLS certificates
fail2ban-client
Intermediate
Fail2ban client to manage ban rules
firewall-cmd
Intermediate
firewalld command line client (RHEL/CentOS)
gpg
Advanced
GNU Privacy Guard - encrypt and sign data
iptables
Advanced
Configure Linux kernel packet filtering firewall rules
md5sum
Beginner
Compute and verify MD5 message digests
nft
Advanced
nftables command line tool (modern firewall)
openssl
Advanced
OpenSSL command line tool for cryptography and SSL/TLS
sha256sum
Beginner
Compute and verify SHA-256 message digests
shred
Intermediate
Securely overwrite and optionally delete files
ufw
Beginner
Uncomplicated Firewall - easy iptables management
Performance & Debugging (10 commands)
fuser
Intermediate
Identify processes using files or sockets
iostat
Intermediate
Report CPU and I/O statistics
iotop
Intermediate
Monitor I/O usage by processes in real time
lsof
Intermediate
List open files and the processes that opened them
sar
Advanced
Collect, report, and save system activity information
strace
Advanced
Trace system calls and signals of a process
taskset
Advanced
Set or retrieve CPU affinity of a process
time
Beginner
Measure command execution time
timeout
Intermediate
Run a command with a time limit
vmstat
Intermediate
Report virtual memory statistics
Frequently Asked Questions
How many Linux commands are there?
What are the most important Linux commands to learn first?
How do I get help for a Linux command?
What is the difference between a command and a shell built-in?
Go Deeper with Our Linux eBooks
Master Linux with our collection of professional IT eBooks
Browse Books →