๐๏ธ 1. File and Directory Management
| Command | Description |
|---|
ls | List directory contents |
cd | Change the current directory |
pwd | Print working directory |
mkdir | Create a new directory |
rmdir | Remove an empty directory |
rm | Remove files or directories |
cp | Copy files or directories |
mv | Move or rename files or directories |
touch | Create an empty file |
find | Search for files and directories |
stat | Show detailed file info |
tree | Display directory structure in a tree format |
basename | Extract filename from path |
dirname | Extract directory path from full path |
๐ 2. File Viewing and Editing
| Command | Description |
|---|
cat | View file contents |
less | View large files (scrollable) |
more | View file contents one page at a time |
head | Show first lines of a file |
tail | Show last lines of a file |
nano | Simple terminal-based text editor |
vim | Advanced terminal-based text editor |
vi | Traditional version of vim |
gedit | GUI text editor (GNOME) |
diff | Compare two files |
cmp | Compare two files byte by byte |
๐ฆ 3. File Permissions and Ownership
| Command | Description |
|---|
chmod | Change file permissions |
chown | Change file ownership |
chgrp | Change group ownership |
umask | Set default file permissions |
ls -l | List file permissions and ownership |
๐ 4. Archiving and Compression
| Command | Description |
|---|
tar | Archive files |
zip / unzip | Compress/decompress ZIP archives |
gzip / gunzip | Compress/decompress with Gzip |
bzip2 / bunzip2 | Compress/decompress with Bzip2 |
xz / unxz | Compress/decompress with XZ |
7z | 7-Zip compression (if installed) |
โ๏ธ 5. System Information
| Command | Description |
|---|
uname -a | Show system information |
hostname | Show or set hostname |
uptime | Show how long the system has been running |
top | Display real-time processes |
htop | Interactive process viewer (if installed) |
whoami | Show current user |
id | Show user and group ID |
df -h | Show disk usage |
du -sh | Show directory size |
free -h | Show memory usage |
vmstat | Show system performance |
lscpu | Show CPU info |
lsblk | List block devices |
lspci | List PCI devices |
lsusb | List USB devices |
๐ง 6. Process Management
| Command | Description |
|---|
ps | Show running processes |
top | Real-time process viewer |
htop | Enhanced version of top |
kill | Kill a process by PID |
killall | Kill processes by name |
nice / renice | Set process priority |
jobs | List background jobs |
fg | Bring job to foreground |
bg | Resume job in background |
๐ 7. Networking
| Command | Description |
|---|
ip a | Show IP addresses |
ifconfig | Show network interfaces (older tool) |
ping | Test network connectivity |
traceroute | Trace the route to a host |
netstat | Network stats (deprecated) |
ss | Modern replacement for netstat |
curl | Transfer data from/to a server |
wget | Download files from the web |
dig | DNS lookup |
nslookup | Query Internet name servers |
host | DNS lookup tool |
scp | Secure file copy between systems |
rsync | Remote/local file synchronization |
๐ 8. User Management
| Command | Description |
|---|
adduser / useradd | Create a new user |
passwd | Change user password |
deluser / userdel | Delete a user |
groupadd | Add new group |
groupdel | Delete a group |
usermod | Modify a user |
groups | Show user groups |
su | Switch user |
sudo | Run command as superuser |
๐ 9. Package Management
๐น Varies by distribution. Here are the main tools per distro:
For Debian/Ubuntu:
| Command | Description |
|---|
apt update | Update package lists |
apt upgrade | Upgrade installed packages |
apt install <pkg> | Install a package |
apt remove <pkg> | Remove a package |
dpkg -i <pkg.deb> | Install .deb file |
For RHEL/CentOS/Fedora:
| Command | Description |
|---|
yum install <pkg> | Install package (older systems) |
dnf install <pkg> | Install package (newer systems) |
rpm -i <pkg.rpm> | Install .rpm file |
For Arch Linux:
| Command | Description |
|---|
pacman -Syu | Update and upgrade |
pacman -S <pkg> | Install package |
โจ๏ธ 10. Shell and Scripting
| Command | Description |
|---|
echo | Print to terminal |
read | Take input from user |
alias | Create command shortcut |
unalias | Remove alias |
which | Show command path |
whereis | Locate binary/source/man page |
man | Show manual pages |
bash | Start a new shell session |
sh | Bourne shell |
history | Show command history |
source | Run commands from a script in the current shell |
๐งช 11. Disk and Filesystem
| Command | Description |
|---|
mount | Mount a device |
umount | Unmount a device |
fsck | Filesystem check |
mkfs | Create a new filesystem |
blkid | Locate/identify devices |
fdisk | Partition a disk |
parted | Disk partitioning tool |
๐งผ 12. System Maintenance
| Command | Description |
|---|
reboot | Reboot system |
shutdown | Shutdown system |
systemctl | Control systemd services |
journalctl | View logs from systemd |
cron / crontab | Schedule tasks |
at | Run tasks at a specified time |
logrotate | Rotate log files |
๐งโโ๏ธ 13. Miscellaneous
| Command | Description |
|---|
date | Show or set the date/time |
cal | Display calendar |
env | Show environment variables |
export | Set environment variable |
time | Measure execution time |
yes | Output a string repeatedly |
sleep | Pause for seconds |
watch | Run command at intervals |
alias | Create command shortcuts |
Please follow and like us: