Linux - Linux commands

There are hundreds of Linux commands, and “complete” lists are massive. However, I can give you a comprehensive, categorized list of the most commonly used Linux commands that are essential for system usage, scripting, networking, file management, process control, user management, and more.

This is ideal for students, beginners, and intermediate users. 


1. File and Directory Commands

Command Description
ls List directory contents
cd Change directory
pwd Print working directory
mkdir Make new directory
rmdir Remove empty directory
rm Remove files or directories
cp Copy files or directories
mv Move or rename files
touch Create new empty file
find Search files and directories
tree Show directory tree
basename Get filename from path
dirname Get directory path from file

2. File Viewing and Editing

Command Description
cat View contents of a file
less View file with scroll (quits with q)
more View file one screen at a time
head Show first lines of a file
tail Show last lines of a file
nano Simple terminal text editor
vim Powerful terminal text editor
echo Print text or write to a file
stat View file info
wc Word/line/char count in file
cut Extract text from files or output
diff Show differences between files

3. File Permissions & Ownership

Command Description
chmod Change file permissions
chown Change file ownership
chgrp Change group ownership
umask Set default file permissions

4. Package Management (Debian/Ubuntu)

Command Description
sudo apt update Refresh package list
sudo apt upgrade Upgrade all installed packages
sudo apt install package Install a new package
sudo apt remove package Remove a package
dpkg -i file.deb Install .deb manually
apt-cache search keyword Search for package

Other systems may use dnf, yum, zypper, or pacman.


5. User Management

Command Description
adduser Add a new user
userdel Delete a user
passwd Change password
whoami Show current username
id Show user ID and groups
groups List group memberships
su Switch user
sudo Run as superuser
chage Manage user password expiry

6. Process Management

Command Description
ps Show running processes
top Live process viewer
htop Enhanced process viewer (if installed)
kill PID Kill process by PID
killall name Kill all processes with given name
nice Start process with priority
renice Change running process priority

7. Disk and Filesystem

Command Description
df -h Show disk space usage
du -sh folder Show size of folder
mount Mount storage device
umount Unmount storage device
lsblk List block devices
blkid Show block device UUIDs
fdisk -l View partitions
mkfs Create filesystem (format a partition)

8. Networking

Command Description
ip a Show IP addresses
ifconfig (Old) Show IP addresses
ping address Ping a server
traceroute address Trace route to server
netstat -tulnp Show open ports
ss -tuln Modern replacement for netstat
dig domain.com DNS lookup
nslookup domain.com DNS lookup (alternative)
wget url Download file
curl url Transfer data (more advanced)
scp Secure file copy (remote)
ssh Connect to a remote machine

9. Archiving and Compression

Command Description
tar -cvf Create archive
tar -xvf Extract archive
gzip file Compress file
gunzip file.gz Decompress file
zip Create zip archive
unzip Extract zip archive

10. System Information

Command Description
uname -a Kernel and system info
hostname Show system name
uptime How long system has been running
free -h Show RAM usage
top Live CPU/memory usage
vmstat Virtual memory stats
lscpu CPU info
lsusb USB device info
lspci PCI device info
dmesg Boot and hardware messages

11. Shell and Scripting

Command Description
alias Create command shortcuts
history Show previous commands
!number Run command from history
script.sh Run shell script (bash script.sh)
export Set environment variables
source Run script in current shell

12. Miscellaneous

Command Description
date Show date and time
cal Show calendar
uptime How long system has been up
who Show logged-in users
env Show environment variables
sleep Pause for set time
watch Re-run a command every few seconds