|
Category |
Command |
Purpose |
Example |
|
File
Management |
ls |
List files
and directories |
ls -l |
|
File
Management |
cd |
Change
directory |
cd /var/log |
|
File
Management |
pwd |
Show current
directory |
pwd |
|
File
Management |
mkdir |
Create
directory |
mkdir devops |
|
File
Management |
rmdir |
Remove empty
directory |
rmdir testdir |
|
File
Management |
rm |
Remove
files/directories |
rm -rf logs/ |
|
File
Management |
cp |
Copy files |
cp file1.txt
file2.txt |
|
File
Management |
mv |
Move/rename
files |
mv old.txt
new.txt |
|
File
Management |
touch |
Create empty
file |
touch app.log |
|
File
Management |
find |
Search files |
find / -name
app.log |
|
File Viewing |
cat |
Display file
content |
cat file.txt |
|
File Viewing |
less |
View file
page by page |
less
/var/log/syslog |
|
File Viewing |
more |
View file
content |
more file.txt |
|
File Viewing |
head |
Show first
lines |
head -10
file.txt |
|
File Viewing |
tail |
Show last
lines |
tail -10
file.txt |
|
File Viewing |
tail -f |
Monitor logs
live |
tail -f
app.log |
|
Text
Processing |
grep |
Search
patterns |
grep
"error" app.log |
|
Text
Processing |
cut |
Extract
columns |
cut
-d":" -f1 /etc/passwd |
|
Text
Processing |
awk |
Process text |
awk '{print
$1}' file.txt |
|
Text
Processing |
sed |
Edit streams |
sed
's/error/warning/g' file.txt |
|
Permissions |
chmod |
Change
permissions |
chmod 755
script.sh |
|
Permissions |
chown |
Change owner |
chown
user:user file.txt |
|
Permissions |
chgrp |
Change group |
chgrp devops
file.txt |
|
Permissions |
umask |
Default
permissions |
umask 022 |
|
Process |
ps |
Show
processes |
ps aux |
|
Process |
top |
Monitor
processes |
top |
|
Process |
htop |
Interactive
monitor |
htop |
|
Process |
kill |
Kill process |
kill 1234 |
|
Process |
killall |
Kill by name |
killall nginx |
|
Process |
nice |
Set priority |
nice -n 10
command |
|
Process |
renice |
Change
priority |
renice 5 -p
1234 |
|
Networking |
ip a |
Show IP
address |
ip a |
|
Networking |
ping |
Test
connectivity |
ping
google.com |
|
Networking |
curl |
HTTP requests |
curl
http://example.com |
|
Networking |
wget |
Download
files |
wget
http://file.com/app.zip |
|
Networking |
netstat |
Network
connections |
netstat
-tulnp |
|
Networking |
ss |
Socket stats |
ss -tuln |
|
Networking |
scp |
Secure copy |
scp file.txt
user@host:/tmp |
|
Networking |
ssh |
Remote login |
ssh
user@192.168.1.10 |
|
Networking |
traceroute |
Trace route |
traceroute
google.com |
|
Disk Usage |
df -h |
Disk usage |
df -h |
|
Disk Usage |
du -sh |
Directory
size |
du -sh
/var/log |
|
Disk Usage |
lsblk |
Block devices |
lsblk |
|
Disk Usage |
mount |
Mount
filesystem |
mount
/dev/sdb1 /mnt |
|
Disk Usage |
fdisk |
Disk
partition |
fdisk -l |
|
System |
uname -a |
System info |
uname -a |
|
System |
uptime |
System uptime |
uptime |
|
System |
free -m |
Memory usage |
free -m |
|
System |
systemctl |
Service
management |
systemctl
status nginx |
|
System |
env |
Environment
variables |
env |
1. File & Directory Management
ls – list files and directoriescd – change directorypwd – print working directorymkdir – create directoryrmdir – remove empty directoryrm – remove files/directoriescp – copy filesmv – move/rename filestouch – create empty filefind – search files/directories|
Category |
Command |
Purpose |
Example |
|
File
Management |
ls |
List files
and directories |
ls -l |
|
File
Management |
cd |
Change
directory |
cd /var/log |
|
File
Management |
pwd |
Show current
directory |
pwd |
|
File
Management |
mkdir |
Create
directory |
mkdir devops |
|
File
Management |
rmdir |
Remove empty
directory |
rmdir testdir |
|
File
Management |
rm |
Remove
files/directories |
rm -rf logs/ |
|
File
Management |
cp |
Copy files |
cp file1.txt
file2.txt |
|
File
Management |
mv |
Move/rename
files |
mv old.txt
new.txt |
|
File
Management |
touch |
Create empty
file |
touch app.log |
|
File
Management |
find |
Search files |
find / -name
app.log |
2. File Viewing & Text Processing
cat – view file contentless – paginated file viewmore – view file contenthead – first 10 linestail – last 10 linestail -f – live log monitoringgrep – search text patternscut – extract columnsawk – text processingsed – stream editor|
Category |
Command |
Purpose |
Example |
|
File Viewing |
cat |
Display file
content |
cat file.txt |
|
File Viewing |
less |
View file
page by page |
less
/var/log/syslog |
|
File Viewing |
more |
View file
content |
more file.txt |
|
File Viewing |
head |
Show first
lines |
head -10
file.txt |
|
File Viewing |
tail |
Show last
lines |
tail -10
file.txt |
|
File Viewing |
tail -f |
Monitor logs
live |
tail -f
app.log |
3. Permissions & Ownership
chmod – change permissionschown – change ownerchgrp – change groupumask – default permissions|
Category |
Command |
Purpose |
Example |
|
Permissions |
chmod |
Change
permissions |
chmod 755
script.sh |
|
Permissions |
chown |
Change owner |
chown
user:user file.txt |
|
Permissions |
chgrp |
Change group |
chgrp devops
file.txt |
|
Permissions |
umask |
Default
permissions |
umask 022 |
|
Category |
Command |
Purpose |
Example |
|
Text
Processing |
grep |
Search
patterns |
grep
"error" app.log |
|
Text
Processing |
cut |
Extract
columns |
cut
-d":" -f1 /etc/passwd |
|
Text
Processing |
awk |
Process text |
awk '{print
$1}' file.txt |
|
Text
Processing |
sed |
Edit streams |
sed
's/error/warning/g' file.txt |
4. Process Management
ps – running processestop – live process monitoringhtop – advanced process viewerkill – terminate processkillall – kill by namenice – set process priorityrenice – change priority|
Category |
Command |
Purpose |
Example |
|
Process |
ps |
Show
processes |
ps aux |
|
Process |
top |
Monitor
processes |
top |
|
Process |
htop |
Interactive
monitor |
htop |
|
Process |
kill |
Kill process |
kill 1234 |
|
Process |
killall |
Kill by name |
killall nginx |
|
Process |
nice |
Set priority |
nice -n 10
command |
|
Process |
renice |
Change
priority |
renice 5 -p
1234 |
5. Networking
ifconfig / ip a – network interfacesping – test connectivitycurl – API/URL requestswget – download filesnetstat – network connectionsss – socket statisticsscp – secure file copyssh – remote logintraceroute – network path tracing|
Category |
Command |
Purpose |
Example |
|
Networking |
ip a |
Show IP
address |
ip a |
|
Networking |
ping |
Test
connectivity |
ping
google.com |
|
Networking |
curl |
HTTP requests |
curl
http://example.com |
|
Networking |
wget |
Download
files |
wget
http://file.com/app.zip |
|
Networking |
netstat |
Network
connections |
netstat
-tulnp |
|
Networking |
ss |
Socket stats |
ss -tuln |
|
Networking |
scp |
Secure copy |
scp file.txt
user@host:/tmp |
|
Networking |
ssh |
Remote login |
ssh
user@192.168.1.10 |
|
Networking |
traceroute |
Trace route |
traceroute
google.com |
6. Disk & Storage
df -h – disk usagedu -sh – directory sizelsblk – block devicesmount – mount filesystemfdisk – disk partitioning|
Category |
Command |
Purpose |
Example |
|
Disk Usage |
df -h |
Disk usage |
df -h |
|
Disk Usage |
du -sh |
Directory
size |
du -sh
/var/log |
|
Disk Usage |
lsblk |
Block devices |
lsblk |
|
Disk Usage |
mount |
Mount
filesystem |
mount
/dev/sdb1 /mnt |
|
Disk Usage |
fdisk |
Disk
partition |
fdisk -l |
7. System & Package Management
uname -a – system infouptime – system uptimefree -m – memory usagesystemctl – service managementapt/yum/dnf – package management|
Category |
Command |
Purpose |
Example |
|
System |
uname -a |
System info |
uname -a |
|
System |
uptime |
System uptime |
uptime |
|
System |
free -m |
Memory usage |
free -m |
|
System |
systemctl |
Service
management |
systemctl
status nginx |
|
System |
env |
Environment
variables |
env |
Bonus (Very Important for DevOps)
-
journalctl– system logs -
crontab– scheduled jobs -
docker– container management -
kubectl– Kubernetes control -
env– environment variables

