|
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 directories
cd – change directory
pwd – print working directory
mkdir – create directory
rmdir – remove empty directory
rm – remove files/directories
cp – copy files
mv – move/rename files
touch – create empty file
find – 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 content
less – paginated file view
more – view file content
head – first 10 lines
tail – last 10 lines
tail -f – live log monitoring
grep – search text patterns
cut – extract columns
awk – text processing
sed – 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 permissions
chown – change owner
chgrp – change group
umask – 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 processes
top – live process monitoring
htop – advanced process viewer
kill – terminate process
killall – kill by name
nice – set process priority
renice – 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 interfaces
ping – test connectivity
curl – API/URL requests
wget – download files
netstat – network connections
ss – socket statistics
scp – secure file copy
ssh – remote login
traceroute – 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 usage
du -sh – directory size
lsblk – block devices
mount – mount filesystem
fdisk – 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 info
uptime – system uptime
free -m – memory usage
systemctl – service management
apt/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