Guides
दररोज DevOps Engineer वापरतो ती Linux Commands
By Ravindra Bagale, DevOps trainer · LinkedIn · Published: · Last updated:
Amazon Linux/Ubuntu वर DevOps ची रोजची भाषा. Infosys, TCS style on-call प्रमाणे output शिका.
Friends, memorize the order: disk, process, ports, logs. Chala mitrano — type them until muscle memory.
मित्रांनो, क्रम लक्षात ठेवा: disk, process, ports, logs. Chala mitrano — स्नायूंच्या स्मृतीत येईपर्यंत टाइप करा.
मित्रों, क्रम याद रखें: disk, process, ports, logs। Chala mitrano — मांसपेशी की याद तक टाइप करें।
Quick answer
Hold this vertical picture:
- df/du.
- ps/uptime.
- ss/curl.
- systemctl/journalctl.
- प्रत्येक outage हाच क्रम.
Language: English · मराठी · हिंदी
Daily Linux outage path
हे commands दररोज का
Flipkart sale किंवा Infosys client slow असेल तर seniors textbook उघडत नाहीत. Disk, process, port, log checks चालतात.
Why: जलद triage MTTR वाचवते.
What: Sample output सह छोटा daily set.
How: स्वतःच्या VM वर सराव. प्रत्येक column वाचा.
Concept 1: Disk आणि memory
Why: Full disk apps मारते.
What: df, du, free, df -i.
How: आधी / आणि /var.
Example 1: Disk free
Type this:
You will see:
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p1 8.0G 3.1G 4.9G 39% /
What it means: Root at 39 percent. Above 90 percent needs cleanup.
Example 2: Biggest dirs
Type this:
du -h -d1 /var 2>/dev/null | sort -h | tail -3
You will see:
1.2G /var/log
2.0G /var/lib
3.4G /var
What it means: /var/log often fills first on app servers.
Example 3: Inode check
Type this:
You will see:
/dev/nvme0n1p1 524288 81234 443054 16% /
What it means: Inode exhaustion can block creates even when bytes remain.
Concept 2: Process आणि load
Why: एक runaway process box उपाशी ठेवतो.
What: ps, top, uptime.
How: CPU ने sort करा.
Example 4: Top CPU snapshot
Type this:
ps aux --sort=-%cpu | head -n 4
You will see:
USER PID %CPU %MEM COMMAND
root 1 0.0 0.2 systemd
...
What it means: Read the COMMAND column in outages.
Example 5: Memory free
Type this:
You will see:
total used free
Mem: 3.7Gi 1.2Gi 1.1Gi
What it means: Watch available, not only free.
Example 6: Load average
Type this:
You will see:
14:02:11 up 3 days, 2 users, load average: 0.15, 0.10, 0.05
What it means: Three numbers: 1, 5, 15 minute averages.
Concept 3: Ports आणि HTTP
Why: चुकीचा bind तास वाया.
What: ss, curl, scp.
How: Restart आधी listen confirm.
Example 7: Listen ports
Type this:
You will see:
Netid State Local Address:Port
tcp LISTEN 0.0.0.0:22
tcp LISTEN 0.0.0.0:80
What it means: See who owns port 80 before nginx fights.
Example 8: HTTP check
Type this:
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/
You will see:
What it means: 200 means the edge answered. Not a full app health check.
Example 9: Copy with scp mind-set
Type this:
printf '%s\n' 'scp report.txt ec2-user@10.0.0.5:/home/ec2-user/'
You will see:
scp report.txt ec2-user@10.0.0.5:/home/ec2-user/
What it means: Use keys; never paste passwords into scripts.
Concept 4: Services आणि journals
Why: systemctl = service control plane.
What: is-active, journalctl -u.
How: Blind restart आधी logs.
Example 10: Service active?
Type this:
systemctl is-active sshd || systemctl is-active ssh
You will see:
What it means: active means accepting connections.
Example 11: Recent journal
Type this:
journalctl -u sshd -n 3 --no-pager 2>/dev/null || journalctl -u ssh -n 3 --no-pager
You will see:
-- Logs begin --
... Started OpenSSH ...
What it means: journalctl is the first log stop on systemd hosts.
Example 12: Follow pattern
Type this:
printf '%s\n' 'ss -> process -> journalctl -> restart'
You will see:
ss -> process -> journalctl -> restart
What it means: Daily outage order at Infosys-style accounts.
Pocket order
- df -h /
- free -h
- ss -tulpn
- systemctl status NAME
- journalctl -u NAME -n 50
Pune app server
2 वाजता disk full. du ने /var/log सापडते.
Ravindra Bagale's Tip
On Amazon Linux and Ubuntu labs used at TCS and Capgemini projects, these ten commands solve most night calls. Learn sample output, not only names.
Amazon Linux आणि Ubuntu labs वर TCS/Capgemini style रात्रीच्या calls मध्ये हे दहा commands मदत करतात. फक्त नावे नव्हे, sample output शिका.
Amazon Linux और Ubuntu labs पर TCS/Capgemini style रात की calls में ये दस commands मदद करते हैं। सिर्फ़ नाम नहीं, sample output सीखें।
Check yourself (quiz)
Q1. / वर disk percent?
df -h /
Q2. ss -tulpn?
Listening ports आणि processes.
Q3. journalctl आधी का?
Fail कारण समजण्यासाठी.
Q4. Load average?
1, 5, 15 मिनिटांचे averages.
Q5. Disk full वर पहिला folder?
बहुतेक /var/log.
Reading tracking
Mark this guide when you finish. Your browser remembers it on this device.
क्रम: disk → process → ports → logs.
Did you understand? Let us try it once more.
Frequently asked questions
Which command shows disk percent on /?
df -h /
What does ss -tulpn show?
Listening TCP/UDP ports and processes.
Why journalctl before restart?
So you know why the service failed.
What is load average?
1, 5 and 15 minute run-queue averages.
First folder when disk is full?
Often /var/log.
Daily outage order?
disk → process → ports → logs.