Top 100 Linux Commands

Essential Linux commands every sysadmin should know. Organized by category for quick reference.

File & Directory

CommandDescription
lsList directory contents
ls -laList all files with permissions and sizes
cdChange directory
pwdPrint working directory
mkdir -pCreate directory and parents
rm -rfRemove files/directories recursively (use with caution)
cp -rCopy files/directories recursively
mvMove or rename files
find . -nameFind files by name recursively
locateFind files using index (fast)
touchCreate empty file or update timestamp
ln -sCreate symbolic link
du -shShow disk usage of directory
df -hShow disk free space
statShow file metadata (size, inode, timestamps)

File Viewing & Editing

CommandDescription
catPrint file contents
lessPage through file (q to quit)
head -n 20Show first N lines of file
tail -n 20Show last N lines of file
tail -fFollow file in real time (logs)
grep -rnSearch text recursively with line numbers
awkPattern scanning and processing language
sedStream editor — find/replace in files
wc -lCount lines in file
sortSort lines alphabetically or numerically
uniqRemove duplicate lines
cut -d: -f1Cut fields from delimited text
diffCompare two files line by line
vim / nanoTerminal text editors

Permissions & Ownership

CommandDescription
chmod 755Set file permissions (rwxr-xr-x)
chown user:groupChange file owner and group
umaskSet default permission mask
sudoExecute command as superuser
su -Switch to root user
passwdChange user password
idShow current user UID/GID/groups
groupsList user group memberships

Process Management

CommandDescription
ps auxList all running processes
top / htopInteractive process monitor
kill -9 PIDForce kill process by PID
killall nameKill all processes by name
pkillKill processes matching pattern
jobsList background jobs in current shell
bg / fgResume job in background / foreground
nohupRun command immune to hangups
nice / reniceSet process CPU priority
lsofList open files and sockets
straceTrace system calls of a process

Networking

CommandDescription
ip addrShow network interfaces and IPs
ip routeShow routing table
ping -c 4Test connectivity to host
tracerouteTrace network path to host
nslookup / digDNS lookup utilities
curl -IFetch HTTP headers from URL
wgetDownload files from web
ss -tulpnShow open ports and listening services
netstat -anShow network connections
iptables -LList firewall rules
ssh user@hostConnect to remote host via SSH
scp src dstSecure copy files over SSH
rsync -avzSync files/dirs with progress and compression
nmap -sVScan host ports and service versions
tcpdump -i eth0Capture network packets on interface

System Info & Hardware

CommandDescription
uname -aPrint kernel version and system info
uptimeSystem uptime and load average
free -hShow RAM usage in human-readable form
vmstat 1Virtual memory stats every second
iostatCPU and disk I/O statistics
lscpuDisplay CPU architecture information
lsblkList block devices (disks, partitions)
lsusb / lspciList USB and PCI devices
dmesg | tailShow kernel ring buffer / boot messages
hostnamectlShow or set system hostname and OS info
timedatectlShow or set system time and timezone

Package Management

CommandDescription
apt update && apt upgradeUpdate package list and upgrade (Debian/Ubuntu)
apt install pkgInstall a package (Debian/Ubuntu)
apt remove pkgRemove a package
dpkg -lList all installed packages (Debian)
yum / dnf installInstall package (RHEL/CentOS/Fedora)
rpm -qaList all installed RPM packages

Services & systemd

CommandDescription
systemctl status svcCheck service status
systemctl start svcStart a service
systemctl stop svcStop a service
systemctl restart svcRestart a service
systemctl enable svcEnable service at boot
systemctl disable svcDisable service at boot
journalctl -u svcView logs for a specific service
journalctl -fFollow system journal in real time
crontab -eEdit user cron jobs

Archives & Compression

CommandDescription
tar -czvf out.tgz dir/Create gzipped tarball
tar -xzvf file.tgzExtract gzipped tarball
zip -r out.zip dir/Create zip archive
unzip file.zipExtract zip archive
gzip / gunzipCompress / decompress .gz files

Shell & Scripting

CommandDescription
echoPrint text to stdout
export VAR=valSet environment variable
envList all environment variables
aliasCreate command shortcuts
historyShow command history
source / .Execute script in current shell
bash script.shRun a shell script
which / whereisFind location of a command binary
man cmdShow manual page for command
xargsBuild and execute commands from stdin
teeRead from stdin, write to stdout and file