<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[90-Days-DevOps-with-Shubham]]></title><description><![CDATA[90-Days-DevOps-with-Shubham]]></description><link>https://90-days-devops-with-shubham.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>90-Days-DevOps-with-Shubham</title><link>https://90-days-devops-with-shubham.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 19 Jun 2026 21:52:53 GMT</lastBuildDate><atom:link href="https://90-days-devops-with-shubham.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[From Zero to Understanding: DNS, IPs, CIDR, Subnets & Ports]]></title><description><![CDATA[When I first started learning networking, everything felt overwhelming — DNS, IPs, CIDR, subnets, ports. None of it made sense. But once I broke it down step by step, it all started connecting.
Unders]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/from-zero-to-understanding-dns-ips-cidr-subnets-ports</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/from-zero-to-understanding-dns-ips-cidr-subnets-ports</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sun, 19 Apr 2026 18:27:30 GMT</pubDate><content:encoded><![CDATA[<p>When I first started learning networking, everything felt overwhelming — DNS, IPs, CIDR, subnets, ports. None of it made sense. But once I broke it down step by step, it all started connecting.</p>
<p>Understanding networking is not just theory — it’s the foundation of how real systems communicate in a DevOps environment.</p>
<hr />
<h3>What happens when you type a website in a browser?</h3>
<p>When you type something like:</p>
<p>google.com</p>
<p>A lot happens behind the scenes:</p>
<ol>
<li><p>Your browser checks cache (already known IP?)</p>
</li>
<li><p>Your system asks DNS: “What is the IP address for this domain?”</p>
</li>
<li><p>DNS responds with an IP (like 142.x.x.x)</p>
</li>
<li><p>Your browser connects to that IP using a port (usually 80 or 443)</p>
</li>
<li><p>A request is sent to the server</p>
</li>
<li><p>The server responds with the website</p>
</li>
</ol>
<p>👉 So the full chain is:</p>
<p>Domain → DNS → IP → Port → Server → Response</p>
<p>👉 Think of it like:</p>
<blockquote>
<p>Typing a contact name → phonebook → dialing the number</p>
</blockquote>
<hr />
<h3>What is an IP address?</h3>
<p>An IP address is like a <strong>home address for a device</strong>.</p>
<p>An IPv4 address looks like:</p>
<pre><code class="language-plaintext">192.168.1.10
</code></pre>
<p>👉 It has 4 parts (octets):</p>
<ul>
<li>Each part ranges from <code>0–255</code></li>
</ul>
<p>Why 255?</p>
<p>Because each octet = 8 bits And 2⁸ = 256 values (0–255)</p>
<ul>
<li>Total = 32 bits</li>
</ul>
<p>Think of it as the identity of a machine in a network.</p>
<hr />
<h3>What is DNS?</h3>
<ul>
<li><p>DNS (Domain Name System) is like a phonebook.</p>
</li>
<li><p>Instead of remembering IPs like: 142.250.73.142</p>
</li>
</ul>
<p><code>We use: google.com</code></p>
<blockquote>
<p>DNS translates: Domain → IP address</p>
</blockquote>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/fc47500e-6194-4074-9812-8e7a471baeb4.png" alt="" style="display:block;margin:0 auto" />

<blockquote>
<p>DNS exists because humans can’t remember IP addresses easily.</p>
</blockquote>
<hr />
<h3>DNS Record Types</h3>
<table>
<thead>
<tr>
<th>Record</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>A</td>
<td>Domain → IPv4 address</td>
</tr>
<tr>
<td>AAAA</td>
<td>Domain → IPv6 address</td>
</tr>
<tr>
<td>CNAME</td>
<td>Alias to another domain</td>
</tr>
<tr>
<td>MX</td>
<td>Mail server</td>
</tr>
<tr>
<td>NS</td>
<td>DNS servers for domain</td>
</tr>
</tbody></table>
<h3>Example:</h3>
<ul>
<li><p><a href="http://google.com"><code>google.com</code></a> <code>→ A → 142.250.73.142</code></p>
</li>
<li><p><a href="http://www.example.com"><code>www.example.com</code></a> <code>→ CNAME →</code> <a href="http://example.com"><code>example.com</code></a></p>
</li>
</ul>
<hr />
<h3>How DNS connects to IP</h3>
<blockquote>
<p>DNS = translates human names → IP addresses</p>
</blockquote>
<p><code>DNS converts google.com → 142.250.x.x so computers can talk.</code></p>
<ul>
<li><p>User enters domain</p>
</li>
<li><p>DNS resolves it</p>
</li>
<li><p>IP is returned</p>
</li>
</ul>
<p>👉 This is how human-friendly names connect to machine-level communication.</p>
<hr />
<h3>Real-life analogy</h3>
<p>Think of your phone:</p>
<p>You save: “Mom” Phone actually uses: +91-XXXXXXXXXX</p>
<p>👉 DNS works the same way:</p>
<ul>
<li><p>You type: <a href="http://google.com">google.com</a></p>
</li>
<li><p>Internet uses: <strong>an IP address</strong></p>
</li>
</ul>
<hr />
<h2>Now let’s go deeper into how DNS actually works:</h2>
<h3>Step-by-step (what actually happens)</h3>
<ol>
<li>You type a domain</li>
</ol>
<pre><code class="language-plaintext">google.com
</code></pre>
<ol>
<li>Browser asks DNS resolver</li>
</ol>
<pre><code class="language-plaintext"> “What is the IP for this domain?”
</code></pre>
<ol>
<li>DNS looks up records</li>
</ol>
<p>It checks different record types:</p>
<ul>
<li><p><strong>A record</strong> → IPv4 address</p>
</li>
<li><p><strong>AAAA record</strong> → IPv6 address</p>
</li>
</ul>
<p>4. DNS returns IP</p>
<p>Example:</p>
<pre><code class="language-plaintext">google.com → 142.250.73.142
</code></pre>
<p>5. Your system connects to that IP</p>
<p>👉 Now networking begins:</p>
<ul>
<li><p>TCP connection</p>
</li>
<li><p>Port (like 80 or 443)</p>
</li>
<li><p>Data transfer</p>
</li>
</ul>
<hr />
<h3>Where DNS gets the answer from</h3>
<p>DNS is like a chain:</p>
<ol>
<li><p>Your system cache</p>
</li>
<li><p>ISP / local DNS server</p>
</li>
<li><p>Root servers</p>
</li>
<li><p>TLD servers (.com)</p>
</li>
<li><p>Authoritative DNS</p>
</li>
</ol>
<p>👉 Finally returns the IP</p>
<hr />
<h3>Example from command</h3>
<p>You ran:</p>
<pre><code class="language-plaintext">dig google.com
</code></pre>
<p>You saw:</p>
<pre><code class="language-plaintext">google.com. 141 IN A 142.250.73.142
</code></pre>
<p>👉 This means:</p>
<ul>
<li><p>Domain → <a href="http://google.com"><code>google.com</code></a></p>
</li>
<li><p>Record type → A</p>
</li>
<li><p>IP → <code>142.250.73.142</code></p>
</li>
<li><p>TTL → 141 seconds</p>
</li>
</ul>
<h3>Why this matters</h3>
<p>Without DNS:</p>
<p>👉 You would have to remember:</p>
<pre><code class="language-plaintext">142.250.73.142
</code></pre>
<p>Instead of:</p>
<pre><code class="language-plaintext">google.com
</code></pre>
<h3>Remember:</h3>
<ul>
<li><p>DNS = <strong>phonebook</strong></p>
</li>
<li><p>Domain = <strong>contact name</strong></p>
</li>
<li><p>IP = <strong>phone number</strong></p>
</li>
</ul>
<blockquote>
<p>DNS connects domain names to IP addresses so computers can locate each other on the internet.</p>
</blockquote>
<hr />
<h3>Public vs Private IP</h3>
<p>→ tells you <em>what kind of IP it is</em></p>
<ul>
<li><p>Public IP → accessible from internet</p>
<ul>
<li><p>Example:</p>
<pre><code class="language-plaintext">8.8.8.8
</code></pre>
</li>
</ul>
</li>
<li><p>Private IP → used inside networks</p>
<ul>
<li><p><code>10.x.x.x</code></p>
</li>
<li><p><code>172.16–31.x.x</code></p>
</li>
<li><p><code>192.168.x.x</code></p>
</li>
</ul>
<p>Example:</p>
<pre><code class="language-plaintext">172.31.32.167
</code></pre>
<p>👉 Private = internal use<br />👉 Public = internet facing</p>
</li>
</ul>
<hr />
<h3>What is a Subnet?</h3>
<p>Subnet = a smaller network inside a bigger network</p>
<p>That’s it.</p>
<hr />
<h3>Real-life analogy</h3>
<p>Think of:</p>
<blockquote>
<p>Internet = country</p>
<p>Network = city</p>
<p>Subnet = neighborhood</p>
</blockquote>
<p>👉 You divide a big area into smaller manageable parts.</p>
<hr />
<h3>In networking terms</h3>
<p>A subnet is:</p>
<blockquote>
<p>A group of IP addresses that belong to the same network range</p>
</blockquote>
<p>Defined using:</p>
<ul>
<li><p><strong>CIDR</strong> (<code>/24</code>, <code>/20</code>, etc.)</p>
</li>
<li><p>or <strong>Subnet mask</strong> (<code>255.255.255.0</code>)</p>
</li>
</ul>
<h3>Example</h3>
<pre><code class="language-plaintext">192.168.1.10/24
</code></pre>
<p>👉 This means:</p>
<ul>
<li><p>Network (subnet) = <code>192.168.1.0</code></p>
</li>
<li><p>Range = <code>192.168.1.0 → 192.168.1.255</code></p>
</li>
</ul>
<p>👉 All these IPs are in <strong>one subnet</strong></p>
<hr />
<h3>Why subnetting is used</h3>
<p>1. Organization</p>
<p>Split big network into smaller ones</p>
<p>2. Security</p>
<p>Control access between subnets</p>
<p>3. Performance</p>
<p>Reduce unnecessary traffic</p>
<hr />
<h3>Example in real world</h3>
<p>Let’s say a company has:</p>
<pre><code class="language-plaintext">10.0.0.0/16
</code></pre>
<p>👉 Huge network (65,536 IPs)</p>
<p>They divide it:</p>
<table>
<thead>
<tr>
<th>Subnet</th>
<th>Use</th>
</tr>
</thead>
<tbody><tr>
<td>10.0.1.0/24</td>
<td>Backend</td>
</tr>
<tr>
<td>10.0.2.0/24</td>
<td>Frontend</td>
</tr>
<tr>
<td>10.0.3.0/24</td>
<td>Database</td>
</tr>
</tbody></table>
<p>👉 Each is a subnet</p>
<hr />
<p>Key Idea</p>
<p>👉 Subnet = <strong>CIDR-defined range of IPs</strong></p>
<hr />
<h3>Remember:</h3>
<ul>
<li><p>IP → one house</p>
</li>
<li><p>Subnet → group of houses</p>
</li>
<li><p>Network → city</p>
</li>
</ul>
<blockquote>
<p>A subnet is a logical division of an IP network defined by a CIDR range.</p>
</blockquote>
<hr />
<h3>What is CIDR?</h3>
<p>CIDR looks like:</p>
<pre><code class="language-plaintext">192.168.1.10/24
</code></pre>
<p>The /24 means:</p>
<p>👉 First 24 bits = network</p>
<p>👉 Remaining bits = hosts</p>
<blockquote>
<p>How big the network is</p>
</blockquote>
<h3>Core Idea</h3>
<ul>
<li><p>IP = address</p>
</li>
<li><p>CIDR = <strong>range size</strong></p>
</li>
</ul>
<h3>Example: <code>/24</code></h3>
<pre><code class="language-plaintext">192.168.1.10/24
</code></pre>
<p>👉 Means:</p>
<ul>
<li><p>Network: <code>192.168.1.0</code></p>
</li>
<li><p>Range: <code>192.168.1.0 → 192.168.1.255</code></p>
</li>
<li><p>Total IPs: <strong>256</strong></p>
</li>
</ul>
<pre><code class="language-plaintext">
192.168.1.0/24  
→ Total IPs: 256  
→ Network: .0  
→ Broadcast: .255  
</code></pre>
<hr />
<h3>Example: <code>/20</code></h3>
<pre><code class="language-plaintext">172.31.32.167/20
</code></pre>
<p>👉 Step:</p>
<ul>
<li><p>Mask = <code>255.255.240.0</code></p>
</li>
<li><p>Block size = <code>256 - 240 = 16</code></p>
</li>
</ul>
<p>👉 Range:</p>
<pre><code class="language-plaintext">172.31.32.0 → 172.31.47.255
</code></pre>
<p>👉 Total IPs:</p>
<pre><code class="language-plaintext">4096
</code></pre>
<hr />
<h3>CIDR Memory Trick</h3>
<table>
<thead>
<tr>
<th>CIDR</th>
<th>Size</th>
</tr>
</thead>
<tbody><tr>
<td>/24</td>
<td>256</td>
</tr>
<tr>
<td>/20</td>
<td>4096</td>
</tr>
<tr>
<td>/16</td>
<td>65536</td>
</tr>
</tbody></table>
<p>👉 Lower CIDR = bigger network<br />👉 Higher CIDR = smaller network</p>
<hr />
<h3>Key Table</h3>
<table>
<thead>
<tr>
<th>Value</th>
<th>Bits</th>
</tr>
</thead>
<tbody><tr>
<td>255</td>
<td>8</td>
</tr>
<tr>
<td>254</td>
<td>7</td>
</tr>
<tr>
<td>252</td>
<td>6</td>
</tr>
<tr>
<td>248</td>
<td>5</td>
</tr>
<tr>
<td>240</td>
<td>4</td>
</tr>
<tr>
<td>224</td>
<td>3</td>
</tr>
<tr>
<td>192</td>
<td>2</td>
</tr>
<tr>
<td>128</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
</tr>
</tbody></table>
<hr />
<h3>Subnet Mask from CIDR</h3>
<p>Example:</p>
<p>/20</p>
<p>Step:</p>
<p>20 bits = 8 + 8 + 4 + 0</p>
<p>Binary: 11111111.11111111.11110000.00000000</p>
<p>Convert:</p>
<p>255.255.240.0</p>
<p>👉 Final: CIDR /20 = Subnet Mask 255.255.240.0</p>
<hr />
<h3>Reverse (Subnet Mask → CIDR)</h3>
<p>Example:</p>
<pre><code class="language-plaintext">255.255.255.0 → /24
</code></pre>
<p>👉 Count 255s:</p>
<ul>
<li>255 = 8 bits</li>
</ul>
<pre><code class="language-plaintext">8 + 8 + 8 = /24
</code></pre>
<hr />
<p>Example:</p>
<pre><code class="language-plaintext">255.255.192.0 → /18
</code></pre>
<p>👉 192 = 2 bits</p>
<pre><code class="language-plaintext">8 + 8 + 2 = /18
</code></pre>
<hr />
<p>Subnet/CIDR concepts are best understood using ranges, examples, and breakdowns.</p>
<p>Example:</p>
<pre><code class="language-plaintext">192.168.1.0/24
→ 256 IPs
→ .0 network
→ .255 broadcast
</code></pre>
<hr />
<h3>What is Block Size?</h3>
<p>Formula:</p>
<p>Block size = 256 − subnet value</p>
<p>Example:</p>
<p>/20 → mask</p>
<p>20 = 8 + 8 + 4 +0 → 255.255.240.0</p>
<pre><code class="language-plaintext">/20 → 255.255.240.0
</code></pre>
<p>👉 Focus on <code>240</code></p>
<pre><code class="language-plaintext">256 - 240 = 16
</code></pre>
<p>👉 Blocks:</p>
<pre><code class="language-plaintext">0–15
16–31
32–47 ✅
48–63
</code></pre>
<p>👉 Since <code>32</code> falls in <code>32–47</code>, that’s your range.</p>
<hr />
<h3>What does Block Size mean?</h3>
<p>It means how the network is divided.</p>
<p>Example block size 16:</p>
<ul>
<li><p>0–15</p>
</li>
<li><p>16–31</p>
</li>
<li><p>32–47</p>
</li>
<li><p>48–63</p>
</li>
</ul>
<hr />
<h3>Example: 172.31.32.167/20</h3>
<p>Step 1: Block size = 16</p>
<p>Step 2: Find where 32 fits:</p>
<p>0–15</p>
<p>16–31</p>
<p>32–47 ✅</p>
<h3>Final Range:</h3>
<p>172.31.32.0 → 172.31.47.255</p>
<p>👉 Always subtract using <strong>mask</strong>, not IP</p>
<hr />
<h3>Fast Method (No Binary)</h3>
<p>Steps:</p>
<ol>
<li><p>Find CIDR → get mask</p>
</li>
<li><p>Find block size</p>
</li>
<li><p>Look at octet</p>
</li>
<li><p>Place IP in range</p>
</li>
</ol>
<hr />
<h3>How to Identify Range in 5 Seconds</h3>
<p>Example:</p>
<pre><code class="language-plaintext">192.168.70.10/18
</code></pre>
<p>18 = 8 + 8 + 2 +0 = 255 + 255 + 192 + 0</p>
<p>👉 Block size = 256 − 192 = 64</p>
<pre><code class="language-plaintext">0–63
64–127 ✅
128–191
192–255
</code></pre>
<p>👉 So range:</p>
<pre><code class="language-plaintext">Network: 192.168.64.0 → 
Broadcast: 192.168.127.255
</code></pre>
<hr />
<h3>Remember:</h3>
<p>CIDR → Mask → Block Size → Buckets → Range</p>
<hr />
<h2>CIDR Extremes (Very Important)</h2>
<p>Refer: <a href="https://cidr.xyz/">https://cidr.xyz/</a></p>
<h2><code>/32</code> — Single IP</h2>
<pre><code class="language-plaintext">10.88.135.144/32
</code></pre>
<ul>
<li><p>Only ONE IP</p>
</li>
<li><p>Mask = <code>255.255.255.255</code></p>
</li>
</ul>
<p>👉 Use:</p>
<ul>
<li><p>Firewall rules</p>
</li>
<li><p>Exact machine targeting</p>
</li>
</ul>
<hr />
<h2><code>/0</code> — Entire Internet</h2>
<pre><code class="language-plaintext">0.0.0.0/0
</code></pre>
<ul>
<li><p>All IPs included</p>
</li>
<li><p>Mask = <code>0.0.0.0</code></p>
</li>
<li><p>Total = 4.29 billion IPs</p>
</li>
</ul>
<p>👉 Use:</p>
<ul>
<li><p>Default route</p>
</li>
<li><p>Allow from anywhere</p>
</li>
</ul>
<hr />
<h3>Comparison</h3>
<table>
<thead>
<tr>
<th>CIDR</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>/32</td>
<td>One device</td>
</tr>
<tr>
<td>/24</td>
<td>Small network</td>
</tr>
<tr>
<td>/16</td>
<td>Large network</td>
</tr>
<tr>
<td>/0</td>
<td>Entire internet</td>
</tr>
</tbody></table>
<hr />
<h3>What are Ports?</h3>
<p>Ports are like doors on a server.</p>
<ul>
<li>One machine → many services</li>
</ul>
<p>Examples:</p>
<ul>
<li><p>80 → HTTP</p>
</li>
<li><p>443 → HTTPS</p>
</li>
<li><p>22 → SSH</p>
</li>
<li><p>3306 → MySQL</p>
</li>
</ul>
<p>👉 Ports allow multiple services to run on the same machine without conflict.</p>
<hr />
<h3>What Happens in:</h3>
<p>Command:</p>
<blockquote>
<p>curl <a href="http://myapp.com:8080">http://myapp.com:8080</a></p>
</blockquote>
<p>Steps:</p>
<ol>
<li><p>DNS resolves <a href="http://myapp.com"><code>myapp.com</code></a></p>
</li>
<li><p>IP returned (multiple A records)</p>
</li>
<li><p>Connect to port <code>8080</code></p>
</li>
<li><p>TCP handshake</p>
</li>
<li><p>HTTP request sent</p>
</li>
</ol>
<p>If it fails:</p>
<p>Check:</p>
<ol>
<li><p>DNS → does domain resolve?</p>
</li>
<li><p>IP → is it reachable?</p>
</li>
<li><p>Port → is 8080 open?</p>
</li>
<li><p>Firewall → blocking?</p>
</li>
<li><p>Service → running?</p>
</li>
</ol>
<hr />
<h3>Real Debugging Example</h3>
<pre><code class="language-plaintext">ubuntu@ip-172-31-32-167:~$ curl http://myapp.com:8080
curl: (28) Failed to connect to myapp.com port 8080 after 300353 ms: Timeout was reached
</code></pre>
<p>You saw:</p>
<pre><code class="language-plaintext">curl timeout
</code></pre>
<p>But:</p>
<pre><code class="language-plaintext">dig myapp.com → works
</code></pre>
<p>👉 Means:</p>
<ul>
<li><p>DNS ✅ working</p>
</li>
<li><p>Network ❌ or port ❌</p>
</li>
</ul>
<h3>What to Check</h3>
<ol>
<li><p>Is port <code>8080</code> open?</p>
</li>
<li><p>Firewall rules?</p>
</li>
<li><p>Server running?</p>
</li>
<li><p>Security group (cloud)?</p>
</li>
<li><p>Correct IP?</p>
</li>
</ol>
<hr />
<h3>Test commands:</h3>
<pre><code class="language-plaintext">ping myapp.com
nc -zv myapp.com 8080
curl http://google.com
</code></pre>
<hr />
<h2>Real DevOps Use Cases</h2>
<h3>Think of it like a delivery system</h3>
<table>
<thead>
<tr>
<th>Concept</th>
<th>What it does</th>
<th>Analogy</th>
</tr>
</thead>
<tbody><tr>
<td>CIDR / VPC</td>
<td>Defines network range</td>
<td>Your city</td>
</tr>
<tr>
<td>Subnet</td>
<td>Splits network</td>
<td>Neighborhoods</td>
</tr>
<tr>
<td>DNS</td>
<td>Converts name → IP</td>
<td>Contact name → phone number</td>
</tr>
<tr>
<td>Port</td>
<td>Identifies service on server</td>
<td>Apartment number</td>
</tr>
<tr>
<td>Load Balancer</td>
<td>Distributes traffic</td>
<td>Receptionist</td>
</tr>
</tbody></table>
<hr />
<h3>Let’s clarify each one (simple)</h3>
<h3>1. CIDR (VPC)</h3>
<p>Example: 10.0.0.0/16 Defines how many IPs you have Used when creating VPC</p>
<p>👉 This is your network boundary</p>
<hr />
<h3>2. Subnets</h3>
<p>Example: Public: 10.0.1.0/24 Private: 10.0.2.0/24</p>
<p>Splits your VPC into parts</p>
<p>👉 This is network organization + security</p>
<hr />
<h3>3. DNS</h3>
<p>Converts: google.com → 142.x.x.x</p>
<p>👉 This is name → IP lookup</p>
<hr />
<h3>4. Ports</h3>
<p>Example: 80 → HTTP 443 → HTTPS</p>
<p>👉 This is which service on the server</p>
<hr />
<h3>5. Load Balancer</h3>
<p>Receives traffic Sends it to backend servers</p>
<p>👉 This is traffic manager</p>
<hr />
<h2>AWS section:</h2>
<p><strong>VPC + Subnet</strong> → tells you where and how those IPs are used</p>
<hr />
<h3>Think of it like a house with rooms</h3>
<ul>
<li><p><strong>VPC (10.0.0.0/16)</strong> = your <strong>entire house</strong></p>
</li>
<li><p><strong>Subnets</strong> = different <strong>rooms inside the house</strong></p>
</li>
</ul>
<hr />
<h3>Inside your “house” (VPC)</h3>
<h3>Public Subnet (10.0.1.0/24)</h3>
<ul>
<li><p>Connected to the internet</p>
</li>
<li><p>Anyone can reach here (with permission)</p>
</li>
</ul>
<p>Used for:</p>
<ul>
<li><p>Load Balancer</p>
</li>
<li><p>Bastion Host</p>
</li>
</ul>
<p>👉 Visitors are allowed here</p>
<hr />
<h3>Private Subnet (10.0.2.0/24)</h3>
<ul>
<li><p>NOT connected to the internet directly</p>
</li>
<li><p>Only accessible internally</p>
</li>
</ul>
<p>Used for:</p>
<ul>
<li><p>Backend servers</p>
</li>
<li><p>Databases</p>
</li>
</ul>
<p>👉 Only trusted systems inside can access</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/a65476f5-8172-44bd-b247-3b20ee5da4f2.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>How they all work together (this is the key)</h3>
<pre><code class="language-plaintext">User types domain
   ↓
DNS → gives IP
   ↓
Request goes to Load Balancer (Public Subnet)
   ↓
Forwarded to App Server (Private Subnet)
   ↓
App talks to Database (Private Subnet)
   ↓
Response goes back
</code></pre>
<hr />
<h3>End-to-end flow (compressed)</h3>
<pre><code class="language-plaintext">User → DNS → Internet → Public Subnet (LB)
     → Private Subnet (App → DB)
     → Response back to user
</code></pre>
<hr />
<h2>Important correction</h2>
<p>❌ DNS is NOT routing traffic like a load balancer</p>
<p>✅ Correct:</p>
<ul>
<li><p>DNS → tells you <strong>WHERE to go (IP address)</strong></p>
</li>
<li><p>Load Balancer → decides <strong>WHICH server handles request</strong></p>
</li>
</ul>
<hr />
<ul>
<li><p>DNS = Address finder</p>
</li>
<li><p>Load Balancer = Traffic controller</p>
</li>
<li><p>Subnet = Security zones</p>
</li>
<li><p>Port = Service gate</p>
</li>
<li><p>CIDR = Network size</p>
</li>
</ul>
<hr />
<h3>In real DevOps environments, these concepts are used daily:</h3>
<ul>
<li><p>CIDR is used while creating VPCs in cloud platforms like AWS</p>
</li>
<li><p>Subnets divide public and private networks</p>
</li>
<li><p>Ports are controlled using security groups and firewalls</p>
</li>
<li><p>DNS is used for routing traffic to services and load balancers</p>
</li>
</ul>
<hr />
<h3>Real-world importance:</h3>
<ul>
<li><p>Subnets are used in cloud isolation and routing</p>
</li>
<li><p>CIDR defines IP allocation and scaling</p>
</li>
</ul>
<hr />
<h3>Simple analogy</h3>
<ul>
<li><p>Public subnet = Shop front</p>
</li>
<li><p>Private subnet = Storage room</p>
</li>
</ul>
<p>Customers → shop front Internal systems → storage room</p>
<hr />
<h3>NETWORK FLOW DIAGRAM</h3>
<pre><code class="language-plaintext">End-to-End Request Flow

User (Browser)
      ↓
DNS → Converts domain → IP
      ↓
Internet Routing
      ↓
Server IP (inside subnet)
      ↓
Port (80 / 443 / custom)
      ↓
Application (Nginx / Backend)
      ↓
Response sent back to user
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/d3758587-26cc-4f88-9f67-63399aab25b3.png" alt="" style="display:block;margin:0 auto" />

<h3>How Everything Connects</h3>
<pre><code class="language-plaintext">When you open a website:

1. DNS converts domain → IP
2. IP identifies the server
3. Subnet determines network grouping
4. Port routes request to correct service
</code></pre>
<hr />
<h3>Key Takeaways</h3>
<ul>
<li><p>DNS converts names → IPs (like a phonebook)</p>
</li>
<li><p>Subnet = grouping</p>
</li>
<li><p>IP identifies machines = address = identity</p>
</li>
<li><p>CIDR defines network size = area size</p>
</li>
<li><p>Subnet splits networks</p>
</li>
<li><p>Block size creates ranges</p>
</li>
<li><p>Ports identify services = door = process routing</p>
</li>
<li><p>curl = knocking</p>
</li>
</ul>
<hr />
<h3>Conclusion</h3>
<p>Networking isn’t magic — it’s just layers:</p>
<pre><code class="language-plaintext">
- IP addresses (identity)
- Find IP (DNS)
- Identify network (CIDR)
- Reach machine (IP)
- Access service (port)
</code></pre>
<hr />
<h3>Final Understanding</h3>
<p>Before:</p>
<p>Everything looked random and confusing</p>
<p>Now:</p>
<p>Everything follows a simple flow:</p>
<p>👉 <code>Name → IP → Network → Range → Port → Service</code></p>
<p>Networking looks complex at first, but once you understand:</p>
<ul>
<li><p>how CIDR maps to subnet masks</p>
</li>
<li><p>how block size creates ranges</p>
</li>
<li><p>how IP fits into those ranges</p>
</li>
</ul>
<p>…it becomes predictable and logical.</p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 14f –Mini Task: Port Probe & Interpretation]]></title><description><![CDATA[This is Part 6 of the Networking for DevOps series.
https://90-days-devops-with-shubham.hashnode.dev/day-14e-how-to-debug-network-issues-like-a-devops-engineer
Step 1: Identify Listening Ports
From yo]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-14f-mini-task-port-probe-interpretation</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-14f-mini-task-port-probe-interpretation</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sun, 19 Apr 2026 14:24:05 GMT</pubDate><content:encoded><![CDATA[<h3>This is Part 6 of the Networking for DevOps series.</h3>
<p><a href="https://90-days-devops-with-shubham.hashnode.dev/day-14e-how-to-debug-network-issues-like-a-devops-engineer">https://90-days-devops-with-shubham.hashnode.dev/day-14e-how-to-debug-network-issues-like-a-devops-engineer</a></p>
<h3>Step 1: Identify Listening Ports</h3>
<p>From your <code>ss -tulpn</code> output, you have:</p>
<ul>
<li><p><strong>22 → SSH</strong></p>
</li>
<li><p><strong>53 → DNS (local resolver)</strong></p>
</li>
<li><p><strong>4330 → custom service</strong></p>
</li>
<li><p><strong>44321, 44322, 44323 → custom/local apps</strong></p>
</li>
</ul>
<pre><code class="language-plaintext">ss -tulpn
</code></pre>
<h3>Step 2: Test One Port</h3>
<p>Let’s take <strong>port 22 (SSH)</strong> as example.</p>
<pre><code class="language-plaintext">nc -zv localhost 22
</code></pre>
<p>Expected output:</p>
<pre><code class="language-plaintext">Connection to localhost 22 port [tcp/ssh] succeeded!
</code></pre>
<hr />
<h3>Alternative Test (HTTP-type ports)</h3>
<p>For something like 4330:</p>
<pre><code class="language-plaintext">curl -I http://localhost:4330
</code></pre>
<ul>
<li><p>If it’s a web service → you’ll get HTTP response</p>
</li>
<li><p>If not → connection may fail or hang</p>
</li>
</ul>
<h3>Observation</h3>
<ul>
<li><p>Ports <strong>22, 53, 4330, 44321–44323</strong> are in LISTEN state.</p>
</li>
<li><p>Testing with <code>nc -zv localhost 22</code> shows <strong>connection successful</strong>.</p>
</li>
<li><p>This confirms the service is reachable locally.</p>
</li>
</ul>
<hr />
<h2><strong>Step 3: Interpretation</strong></h2>
<ul>
<li><p><strong>Reachable →</strong> service running</p>
</li>
<li><p><strong>If Not Reachable</strong></p>
</li>
</ul>
<p>If command shows:</p>
<pre><code class="language-plaintext">Connection refused
</code></pre>
<p>Write:</p>
<p>👉 The port is not reachable.</p>
<h3>Next Checks</h3>
<p>If NOT reachable, check:</p>
<ol>
<li><strong>Service status</strong></li>
</ol>
<pre><code class="language-plaintext">sudo systemctl status ssh
</code></pre>
<ol>
<li><strong>Is service running on that port</strong></li>
</ol>
<pre><code class="language-plaintext">ss -tulpn | grep &lt;port&gt;
</code></pre>
<ol>
<li><strong>Firewall rules</strong></li>
</ol>
<pre><code class="language-plaintext">sudo ufw status
</code></pre>
<p>Result:</p>
<pre><code class="language-plaintext">inactive
</code></pre>
<p>👉 Meaning:</p>
<p>✔ No firewall blocking anything</p>
<p><strong>4. Correct port / protocol</strong></p>
<ul>
<li>Maybe service is not HTTP → <code>curl</code> won’t work</li>
</ul>
<h3>Simple Understanding</h3>
<ul>
<li><p><code>ss</code> → shows “door is open”</p>
</li>
<li><p><code>nc</code> → checks “can I enter that door?”</p>
</li>
<li><p><code>curl</code> → checks “is it a web door?”</p>
</li>
</ul>
<hr />
<h3>Debugging Mindset</h3>
<p>Always troubleshoot layer by layer:</p>
<p>Step 1: DNS</p>
<pre><code class="language-plaintext">dig domain.com
</code></pre>
<p>Step 2: Network</p>
<pre><code class="language-plaintext">ping domain.com
</code></pre>
<p>Step 3: Port</p>
<pre><code class="language-plaintext">nc -zv domain.com 80
</code></pre>
<p>Step 4: Application</p>
<pre><code class="language-plaintext">curl -I http://domain.com 
</code></pre>
<hr />
<h3>Reflection</h3>
<p><strong>Fastest signal when something breaks:</strong></p>
<table>
<thead>
<tr>
<th>Issue</th>
<th>Command</th>
</tr>
</thead>
<tbody><tr>
<td>Host unreachable</td>
<td>ping</td>
</tr>
<tr>
<td>DNS issue</td>
<td>dig / nslookup</td>
</tr>
<tr>
<td>Port closed</td>
<td>nc -zv</td>
</tr>
<tr>
<td>Service down</td>
<td>ss -tulpn</td>
</tr>
<tr>
<td>HTTP issue</td>
<td>curl</td>
</tr>
</tbody></table>
<blockquote>
<p>HTTP issue → curl / curl -I<br />Host reachable → ping<br />DNS issue → dig / nslookup</p>
</blockquote>
<h2>Layer-Based Debugging:</h2>
<h3>If DNS fails:</h3>
<ul>
<li><p>Check Application layer → DNS config</p>
</li>
<li><p>Check:</p>
<pre><code class="language-plaintext">cat /etc/resolv.conf
DNS server
dig domain.com
</code></pre>
</li>
</ul>
<hr />
<h3>If HTTP 500 appears:</h3>
<ul>
<li><p>Application issue → check logs</p>
</li>
<li><p>Means:</p>
<ul>
<li><p>Network OK</p>
</li>
<li><p>TCP works</p>
</li>
<li><p>Server reached</p>
</li>
<li><p>Backend failed</p>
</li>
</ul>
</li>
</ul>
<p>👉 Check:</p>
<ul>
<li><p>Logs</p>
</li>
<li><p>Backend services</p>
</li>
</ul>
<hr />
<h3><strong>Real Incident Follow-ups</strong></h3>
<ol>
<li><strong>Service Check</strong></li>
</ol>
<pre><code class="language-plaintext">systemctl status &lt;service&gt;
journalctl -u &lt;service&gt; -n 50
</code></pre>
<ol>
<li><strong>Network / Firewall</strong></li>
</ol>
<pre><code class="language-plaintext">ufw status
iptables -L
</code></pre>
<ol>
<li><strong>Advanced Checks</strong></li>
</ol>
<pre><code class="language-plaintext">dig google.com @8.8.8.8
cat /etc/resolv.conf
</code></pre>
<hr />
<h2>Now connect the above WhatsApp Example → Linux Tools Mapping</h2>
<pre><code class="language-plaintext"> nc -zv localhost 22
</code></pre>
<p>👉 Checks:</p>
<blockquote>
<p>“Is this door open?”</p>
</blockquote>
<p>✔ SSH works → port is reachable</p>
<p>Like:</p>
<blockquote>
<p>“Can I reach WhatsApp server port?”</p>
</blockquote>
<hr />
<pre><code class="language-plaintext"> curl -I http://...
</code></pre>
<p>👉 Talks to server and asks:</p>
<p>“What do you reply?”</p>
<p>✔ You see headers (response)</p>
<p>Like:</p>
<blockquote>
<p>“Can server respond properly?”</p>
</blockquote>
<hr />
<pre><code class="language-plaintext">dig / nslookup
</code></pre>
<p>👉 Asks:</p>
<blockquote>
<p>“Where is server located?”</p>
</blockquote>
<p>✔ returns IP address</p>
<p>Like WhatsApp finding server location</p>
<hr />
<pre><code class="language-plaintext"> ss -tulpn
</code></pre>
<p>👉 Shows:</p>
<blockquote>
<p>“Which apps are listening on this machine?”</p>
</blockquote>
<p>✔ SSH, custom ports, etc.</p>
<p>Like:</p>
<blockquote>
<p>“Which doors are open on house?”</p>
</blockquote>
<hr />
<h3>Ports (22, 80, 443)</h3>
<p>Think:</p>
<ul>
<li><p>22 → SSH (remote login door)</p>
</li>
<li><p>80 → HTTP (normal web door)</p>
</li>
<li><p>443 → HTTPS (secure web door)</p>
</li>
</ul>
<p><strong>Meaning:</strong></p>
<blockquote>
<p>“Different doors for different services”</p>
</blockquote>
<hr />
<h3>Important concepts we saw in lab</h3>
<h3>Binding (VERY IMPORTANT)</h3>
<ul>
<li><p>0.0.0.0 → open to everyone</p>
</li>
<li><p>127.0.0.1 → only local machine</p>
</li>
</ul>
<p>Meaning:</p>
<blockquote>
<p>“Who is allowed to enter this door?”</p>
</blockquote>
<h3>Firewall (ufw / iptables / AWS SG)</h3>
<ul>
<li><p>ufw status → local firewall check</p>
</li>
<li><p>iptables -L → detailed rules</p>
</li>
<li><p>AWS Security Group → cloud firewall</p>
</li>
</ul>
<p>Meaning:</p>
<blockquote>
<p>“Security guard deciding who enters”</p>
</blockquote>
<h3>Result:</h3>
<ul>
<li><p><strong>nc succeeded</strong> → port open + service alive</p>
</li>
<li><p>connection refused → port closed OR no service</p>
</li>
<li><p>DNS works but port fails → service issue, not network issue</p>
</li>
</ul>
<hr />
<h3><strong>Key Learnings</strong></h3>
<ul>
<li><p>Troubleshooting = <strong>layer-by-layer approach</strong></p>
</li>
<li><p>Always go in order:</p>
<ul>
<li><p>Reachability</p>
</li>
<li><p>DNS</p>
</li>
<li><p>Port</p>
</li>
<li><p>Application</p>
</li>
</ul>
</li>
<li><p>Commands like:</p>
<ul>
<li><p><code>ping</code></p>
</li>
<li><p><code>traceroute</code></p>
</li>
<li><p><code>ss</code></p>
</li>
<li><p><code>dig</code></p>
</li>
<li><p><code>curl</code></p>
</li>
</ul>
</li>
</ul>
<p>👉 Provide <strong>fast, actionable signals</strong></p>
<hr />
<h3><strong>Key Insights</strong></h3>
<ul>
<li><p><code>curl -I</code> → fastest HTTP validation</p>
</li>
<li><p><code>traceroute</code> → reveals real network path</p>
</li>
<li><p><code>ss -tulpn</code> → maps services to ports</p>
</li>
<li><p>DNS can resolve to <strong>multiple IPs (load balancing)</strong></p>
</li>
<li><p>Some ports (like 53) behave differently on TCP vs UDP</p>
</li>
</ul>
<p>This is how I would debug a real production issue at 2 AM — starting from DNS down to application.</p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 14e –How to Debug Network Issues Like a DevOps Engineer]]></title><description><![CDATA[This is Part 5 of the Networking for DevOps series.
https://90-days-devops-with-shubham.hashnode.dev/day-14d-what-really-happens-when-you-hit-a-url-step-by-step
Hands-on Networking Checks
Target Used:]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-14e-how-to-debug-network-issues-like-a-devops-engineer</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-14e-how-to-debug-network-issues-like-a-devops-engineer</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sun, 19 Apr 2026 14:23:49 GMT</pubDate><content:encoded><![CDATA[<h3>This is Part 5 of the Networking for DevOps series.</h3>
<p><a href="https://90-days-devops-with-shubham.hashnode.dev/day-14d-what-really-happens-when-you-hit-a-url-step-by-step">https://90-days-devops-with-shubham.hashnode.dev/day-14d-what-really-happens-when-you-hit-a-url-step-by-step</a></p>
<h2>Hands-on Networking Checks</h2>
<h3>Target Used: google.com</h3>
<h3>1. Identity</h3>
<pre><code class="language-plaintext"> hostname -I
ip addr
</code></pre>
<p>👉 These commands show <strong>all IP addresses and network interfaces on your machine</strong></p>
<p>Think of your system like a house:</p>
<ul>
<li><p>Each <strong>network interface</strong> = a door</p>
</li>
<li><p>Each <strong>IP address</strong> = an address assigned to that door</p>
</li>
</ul>
<h3>Breakdown of your output</h3>
<h3>1️⃣ <code>hostname -I</code></h3>
<pre><code class="language-plaintext">172.71.56.167 172.67.5.9
</code></pre>
<p><strong>What it means:</strong></p>
<ul>
<li><p>Your machine has <strong>multiple IPs</strong></p>
</li>
<li><p>Most important one:</p>
</li>
</ul>
<p>👉 <code>172.71.56.167</code> → your <strong>main private IP (EC2 network)</strong><br />👉 <code>172.67.5.9</code> → These IPs are likely external/public service IPs (not assigned to your EC2 instance)</p>
<p><strong>Observation:</strong></p>
<ul>
<li><p>System has <strong>multiple IP addresses assigned</strong></p>
</li>
<li><p><code>172.71.x.x</code> → Private cloud IP range (varies by VPC configuration)</p>
</li>
<li><p>Shows the system has multiple IP assignments (can be due to interfaces, routing, or networking layers)</p>
</li>
</ul>
<h2>2️⃣ <code>ip addr</code> (this is the real detailed one)</h2>
<h3>🔹 Interface 1: <code>lo</code> (Loopback)</h3>
<pre><code class="language-plaintext">1: lo:
inet 127.0.0.1/8
</code></pre>
<p><strong>Meaning:</strong></p>
<ul>
<li><p>This is <strong>localhost</strong></p>
</li>
<li><p>Used for <strong>internal communication inside the system</strong></p>
</li>
</ul>
<p>👉 Example:</p>
<pre><code class="language-plaintext">curl localhost
</code></pre>
<p><strong>Observation:</strong></p>
<ul>
<li><p><code>127.0.0.1</code> is loopback → used for <strong>internal testing</strong></p>
</li>
<li><p>Always present, never leaves the machine</p>
</li>
</ul>
<hr />
<h3>🔹 Interface 2: <code>ens5</code> (MAIN NETWORK)</h3>
<pre><code class="language-plaintext">2: ens5:
inet 172.71.56.167
</code></pre>
<p><strong>Meaning:</strong></p>
<ul>
<li><p>This is your <strong>actual network interface (like WiFi/Ethernet)</strong></p>
</li>
<li><p>Connected to AWS network</p>
</li>
</ul>
<p>👉 This is the IP used when:</p>
<ul>
<li><p>You SSH into server</p>
</li>
<li><p>Server connects to internet</p>
</li>
</ul>
<p><strong>Extra lines:</strong></p>
<pre><code class="language-plaintext">link/ether 06:cc:88:71:71:3f
</code></pre>
<p>👉 This is <strong>MAC address</strong> (Layer 2 identity)</p>
<hr />
<pre><code class="language-plaintext">state UP
</code></pre>
<p>👉 Interface is <strong>active</strong></p>
<p><strong>Observation:</strong></p>
<ul>
<li><p><code>ens5</code> is the <strong>primary active network interface</strong></p>
</li>
<li><p>Has IP <code>172.71.56.167</code> → used for <strong>external communication</strong></p>
</li>
<li><p>Interface is <strong>UP and functioning correctly</strong></p>
</li>
</ul>
<hr />
<h3>🔹 Interface 3: <code>docker0</code></h3>
<pre><code class="language-plaintext">3: docker0:
inet 172.17.0.1
state DOWN
</code></pre>
<h3>Meaning:</h3>
<ul>
<li><p>This is created by <strong>Docker</strong></p>
</li>
<li><p>Used for <strong>container networking</strong></p>
</li>
</ul>
<p>👉 <code>172.17.0.1</code> = Docker bridge network</p>
<hr />
<pre><code class="language-plaintext">state DOWN
</code></pre>
<p>👉 No containers currently running OR inactive</p>
<p><strong>Observation for :</strong></p>
<ul>
<li><p>Docker bridge network exists (<code>172.17.0.1</code>)</p>
</li>
<li><p>Currently <strong>inactive (DOWN)</strong></p>
</li>
<li><p>Will be used when containers run</p>
</li>
</ul>
<hr />
<h3>Identity Observation for <code>hostname -I and ipaddr</code>:</h3>
<ul>
<li><p>Multiple IP addresses observed using <code>hostname -I</code></p>
</li>
<li><p><code>172.71.56.167</code> is the primary private IP (EC2 network)</p>
</li>
<li><p>Loopback interface (<code>127.0.0.1</code>) is used for internal communication</p>
</li>
<li><p><code>ens5</code> is the main active network interface (UP)</p>
</li>
<li><p>Docker bridge network (<code>172.17.0.1</code>) exists but is currently DOWN</p>
</li>
</ul>
<hr />
<h3>Super Simple Analogy</h3>
<p>Think of it like this:</p>
<ul>
<li><p><code>lo (127.0.0.1)</code> → talking to yourself</p>
</li>
<li><p><code>ens5 (172.71...)</code> → talking to internet</p>
</li>
<li><p><code>docker0 (172.17...)</code> → talking to containers</p>
</li>
</ul>
<hr />
<h3>Important Insight</h3>
<ul>
<li><p><strong>Multiple IPs ≠ multiple machines</strong></p>
<ul>
<li>Shows the system has multiple IP assignments (can be due to interfaces, routing, or networking layers)</li>
</ul>
</li>
<li><p>One machine can have:</p>
<ul>
<li><p>internal IP</p>
</li>
<li><p>public IP</p>
</li>
<li><p>container network IP</p>
</li>
</ul>
</li>
</ul>
<hr />
<h3>2. Reachability</h3>
<pre><code class="language-plaintext">ping -c 4 google.com
</code></pre>
<h3>Why ping -c 4 google.com instead of ping google.com?</h3>
<p><strong>Key difference:</strong></p>
<p>🔸ping google.com → runs <strong>forever</strong> (continuous)</p>
<p>🔸ping -c 4 google.com → sends <strong>only 4 packets and stops</strong></p>
<p>👉 In tasks/labs, we use -c 4 because:</p>
<ul>
<li><p>It’s <strong>controlled</strong></p>
</li>
<li><p>Gives <strong>quick measurable output</strong></p>
</li>
<li><p>Doesn’t require you to press <code>Ctrl + C</code></p>
</li>
</ul>
<hr />
<h3>What actually happened when you ran ping?</h3>
<p>Think of it like this:</p>
<p>👉 Your server is asking:</p>
<p>“Hey Google, are you reachable?”</p>
<p>And Google replies 4 times:</p>
<p>“Yep, I’m here!”</p>
<hr />
<h3>Breakdown of your output</h3>
<pre><code class="language-plaintext">PING google.com (142.251.46.78)
</code></pre>
<p>👉 DNS worked → <code>google.com</code> converted to IP</p>
<p>👉 This means <strong>DNS is working fine</strong></p>
<pre><code class="language-plaintext">64 bytes from ... time=6.07 ms
</code></pre>
<p>👉 Each line = <strong>one reply</strong></p>
<ul>
<li><p><code>time=6 ms</code> → very fast (excellent network)</p>
</li>
<li><p><code>ttl=117</code> → TTL indicates remaining hop limit (helps estimate distance)</p>
</li>
</ul>
<pre><code class="language-plaintext">4 packets transmitted, 4 received, 0% packet loss
</code></pre>
<p>👉 This is the MOST important line</p>
<ul>
<li><p>Sent: 4</p>
</li>
<li><p>Received: 4</p>
</li>
<li><p>Loss: 0%</p>
</li>
</ul>
<p>✅ Network is <strong>healthy</strong></p>
<hr />
<p><strong>Latency = the time it takes for data to travel from your machine → server → back to you</strong></p>
<p>So it’s actually:</p>
<blockquote>
<p>⏱️ <strong>Round-trip time (RTT)</strong></p>
</blockquote>
<h3>In your ping output</h3>
<pre><code class="language-plaintext">time=6.07 ms
</code></pre>
<p>👉 This means:</p>
<ul>
<li><p>Your request went to Google</p>
</li>
<li><p>Google replied back</p>
</li>
<li><p>Total time taken = <strong>6 milliseconds</strong></p>
</li>
</ul>
<h3>Simple analogy</h3>
<p>Think of it like:</p>
<p>You send a message → friend replies</p>
<ul>
<li><p>If reply comes in <strong>1 sec</strong> → low latency</p>
</li>
<li><p>If reply comes in <strong>10 sec</strong> → high latency</p>
</li>
</ul>
<h3>In networking terms</h3>
<table>
<thead>
<tr>
<th>Latency</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>0–10 ms</td>
<td>Excellent</td>
</tr>
<tr>
<td>10–50 ms</td>
<td>Good</td>
</tr>
<tr>
<td>50–100 ms</td>
<td>Okay</td>
</tr>
<tr>
<td>100+ ms</td>
<td>Slow</td>
</tr>
</tbody></table>
<p>Your result: <strong>~6 ms → Excellent</strong></p>
<hr />
<h3>Important distinction</h3>
<p><strong>Latency ≠ Speed (bandwidth)</strong></p>
<table>
<thead>
<tr>
<th>Concept</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>Latency</td>
<td>How fast data starts moving (delay)</td>
</tr>
<tr>
<td>Bandwidth</td>
<td>How much data can move at once</td>
</tr>
</tbody></table>
<hr />
<blockquote>
<p>Latency is the round-trip time taken for a packet to travel to the target and back, measured in milliseconds.</p>
</blockquote>
<pre><code class="language-plaintext">rtt min/avg/max = 6.07 / 6.11 / 6.15 ms
</code></pre>
<p>👉 Round Trip Time (RTT)</p>
<p>🔸 Min → fastest response</p>
<p>🔸 Avg → typical latency</p>
<p>🔸 Max → slowest response</p>
<p>👉 All ~6 ms → <strong>very stable</strong></p>
<hr />
<h3>Reachability Observation</h3>
<ul>
<li><p>Successfully pinged <code>google.com</code> with 0% packet loss</p>
</li>
<li><p>Average latency ~6 ms indicating fast and stable network</p>
</li>
<li><p>DNS resolution worked correctly (domain resolved to IP)</p>
</li>
<li><p>Confirms the system has proper internet connectivity</p>
</li>
</ul>
<h3>Analogy</h3>
<p>Ping is like:</p>
<p>📞 Calling someone 4 times</p>
<p>If they answer every time → network is good</p>
<p>If they miss calls → packet loss</p>
<h3>Important Concepts</h3>
<p><strong>1. Ping uses:</strong></p>
<p>👉 ICMP protocol (NOT TCP/UDP)</p>
<p>👉 Works at Network layer</p>
<p><strong>2. What ping proves:</strong></p>
<table>
<thead>
<tr>
<th>Check</th>
<th>Result</th>
</tr>
</thead>
<tbody><tr>
<td>Internet reachable</td>
<td>✅</td>
</tr>
<tr>
<td>DNS working</td>
<td>✅</td>
</tr>
<tr>
<td>Packet loss</td>
<td>❌ (0%)</td>
</tr>
<tr>
<td>Latency</td>
<td>✅ Good</td>
</tr>
</tbody></table>
<p><strong>3. What ping DOES NOT prove:</strong></p>
<ul>
<li><p>HTTP working</p>
</li>
<li><p>App working</p>
</li>
<li><p>Port open</p>
</li>
</ul>
<p>👉 Only checks <strong>basic connectivity</strong></p>
<p>Ping to google.com was successful with 0% packet loss and ~6 ms latency, confirming stable network connectivity and proper DNS resolution.</p>
<hr />
<h3>3. Network Path</h3>
<pre><code class="language-plaintext">traceroute google.com

or

tracepath google.com
</code></pre>
<p>What is traceroute doing?</p>
<p>You traced the path from your EC2 → Google</p>
<p>👉 And it showed each router (hop) your packet passed through.</p>
<hr />
<h3>Step-by-step breakdown</h3>
<h3>First line</h3>
<pre><code class="language-plaintext">traceroute to google.com (142.251.46.78)
</code></pre>
<p>👉 DNS worked again</p>
<p>👉 google.com → 142.251.46.78</p>
<p>Note: (IP ranges may vary depending on cloud/internal routing)</p>
<p><strong>Hop 1</strong></p>
<pre><code class="language-plaintext"> 1 242.16.82.235 ... ~6 ms
</code></pre>
<p>👉 First router after your machine<br />👉 Likely part of cloud provider or ISP routing</p>
<ul>
<li>~6 ms → fast, normal</li>
</ul>
<hr />
<p><strong>Hop 2</strong></p>
<pre><code class="language-plaintext">2  * * *
</code></pre>
<p>👉 No response</p>
<p>NOT an error<br />👉 Router is blocking ICMP</p>
<hr />
<p><strong>Hop 3</strong></p>
<pre><code class="language-plaintext">3 99.83.117.221 ... ~6 ms
</code></pre>
<p>👉 Traffic moving through internet backbone</p>
<hr />
<p><strong>Hop 4</strong></p>
<pre><code class="language-plaintext">4  * * *
</code></pre>
<p>👉 Again hidden router (normal)</p>
<hr />
<p><strong>Hop 5 (Destination reached)</strong></p>
<pre><code class="language-plaintext">5  72.14.232.192
   pnseab-ad-in-f14.1e100.net (142.251.46.78)
</code></pre>
<p>👉 This is Google’s server</p>
<ul>
<li><p><code>1e100.net</code> → owned by Google</p>
</li>
<li><p>Latency ~6–7 ms → excellent</p>
</li>
</ul>
<h3>Important things you should notice</h3>
<ol>
<li><strong>Multiple IPs in same hop</strong></li>
</ol>
<pre><code class="language-plaintext">242.16.82.235 ... 242.4.194.71 ...
</code></pre>
<p>👉 Means:</p>
<ul>
<li><p>Different paths (load balancing)</p>
</li>
<li><p>Network is dynamic</p>
</li>
</ul>
<p>2. <code>* * *</code> hops</p>
<p>👉 Means:</p>
<ul>
<li><p>Router didn’t reply</p>
</li>
<li><p>But packet still moved forward</p>
</li>
</ul>
<p>3. <strong>Only 5 hops</strong></p>
<p>👉 Very short path → because:</p>
<ul>
<li><p>You’re in a <strong>cloud network (AWS)</strong></p>
</li>
<li><p>Direct peering with Google</p>
</li>
</ul>
<h3>Simple analogy</h3>
<p>Imagine:</p>
<p>Package traveling:</p>
<ul>
<li><p>Warehouse → sorting center → highway → destination</p>
</li>
<li><p>Some checkpoints are visible</p>
</li>
<li><p>Some are hidden</p>
</li>
</ul>
<hr />
<h3>Path Observation</h3>
<ul>
<li><p>Traceroute shows ~5 hops from EC2 instance to destination</p>
</li>
<li><p>Initial latency ~6 ms remains stable across hops</p>
</li>
<li><p>Some hops return <code>* * *</code> due to ICMP filtering (expected behavior)</p>
</li>
<li><p>Destination reached successfully (<a href="http://google.com"><code>google.com</code></a>)</p>
</li>
<li><p>Presence of multiple IPs in a single hop indicates load-balanced routing</p>
</li>
</ul>
<p>Traceroute shows a short path (~5 hops) with stable ~6 ms latency; some hops are hidden due to ICMP filtering, and the destination is successfully reached.</p>
<p>Insight</p>
<ul>
<li><p>If traceroute stops before destination → network issue</p>
</li>
<li><p>If traceroute reaches destination but app fails → app issue</p>
</li>
<li><p>If latency spikes at a hop → bottleneck</p>
</li>
</ul>
<hr />
<h2>Path Observation</h2>
<ul>
<li><p>Traceroute shows ~5 hops from EC2 instance to destination</p>
</li>
<li><p>Initial latency ~6 ms remains stable across hops</p>
</li>
<li><p>Some hops return <code>* * *</code> due to ICMP filtering (expected behavior)</p>
</li>
<li><p>Destination reached successfully (<a href="http://google.com"><code>google.com</code></a>)</p>
</li>
<li><p>Presence of multiple IPs in a single hop indicates load-balanced routing</p>
</li>
</ul>
<p>Traceroute shows a short path (~5 hops) with stable ~6 ms latency; some hops are hidden due to ICMP filtering, and the destination is successfully reached.</p>
<p>Insight</p>
<ul>
<li><p>If traceroute stops before destination → network issue</p>
</li>
<li><p>If traceroute reaches destination but app fails → app issue</p>
</li>
<li><p>If latency spikes at a hop → bottleneck</p>
</li>
</ul>
<hr />
<p>What is <code>tracepath</code> doing?</p>
<p>👉 It shows <strong>how your request travels across the internet hop by hop</strong></p>
<p>Think of it like:</p>
<p>A packet going from your server → Google<br />…and each stop in between is a <strong>router (hop)</strong></p>
<hr />
<h3>Breakdown of your output</h3>
<pre><code class="language-plaintext">1?: [LOCALHOST] pmtu 9001
</code></pre>
<p>👉 Starting point (your machine)</p>
<ul>
<li><code>pmtu 9001</code> → max packet size allowed (AWS uses jumbo frames)</li>
</ul>
<pre><code class="language-plaintext">1: ip-172-71-56-167.us-west-2.compute.internal 0.075ms (example AWS-style internal hostname)
</code></pre>
<p>👉 First hop = <strong>AWS internal router</strong></p>
<ul>
<li>Very low latency → inside same network</li>
</ul>
<p>Note: AWS internal hostnames typically follow private IP ranges such as 172.31.x.x in default VPCs, but actual ranges may vary depending on custom VPC configuration.</p>
<p>(In real environments, internal IP ranges depend on VPC CIDR configuration, not a fixed standard.)</p>
<hr />
<pre><code class="language-plaintext">1: 242.16.82.237 6.813ms
</code></pre>
<p>👉 Now traffic is moving <strong>outside your local network</strong></p>
<ul>
<li>Latency increased → normal</li>
</ul>
<hr />
<pre><code class="language-plaintext">2: no reply
</code></pre>
<p>👉 This is IMPORTANT:</p>
<ul>
<li>Router exists but <strong>not responding to ICMP</strong></li>
</ul>
<p>This is <strong>NORMAL</strong> (not an error)</p>
<hr />
<pre><code class="language-plaintext">3: 99.83.117.221 6.222ms
</code></pre>
<p>👉 Another hop (likely ISP / backbone network)</p>
<hr />
<pre><code class="language-plaintext">4–7: no reply
</code></pre>
<p>👉 Multiple routers not replying</p>
<hr />
<h3>Important concept</h3>
<p>👉 <code>no reply</code> DOES NOT mean failure</p>
<p>It means:</p>
<ul>
<li><p>Router is <strong>configured to ignore trace requests</strong></p>
</li>
<li><p>For <strong>security reasons</strong></p>
</li>
</ul>
<hr />
<h3>Simple analogy</h3>
<p>Imagine:</p>
<p>You’re tracking a delivery truck</p>
<ul>
<li><p>Some checkpoints show location</p>
</li>
<li><p>Some checkpoints are hidden</p>
</li>
</ul>
<p>👉 But the truck is still moving!</p>
<hr />
<h3>Path Observation</h3>
<ul>
<li><p>Traffic passes through multiple network hops before reaching destination</p>
</li>
<li><p>Initial hops show low latency (~0.07 ms → 6 ms), indicating normal routing</p>
</li>
<li><p>Some hops show “no reply” due to ICMP filtering (expected behavior)</p>
</li>
<li><p>Indicates packets are traversing internal AWS network and external internet</p>
</li>
</ul>
<blockquote>
<p>Tracepath shows multiple network hops with increasing latency; some hops do not respond due to ICMP filtering, which is normal in real-world networks.</p>
</blockquote>
<hr />
<p>traceroute/tracepath is one of those things that looks complex but is actually simple once you see the pattern</p>
<h3>Core idea</h3>
<p>👉 Both traceroute and tracepath show the path your data takes to reach a destination</p>
<p>That’s it.</p>
<h3>Simple analogy</h3>
<p>Imagine you’re traveling from Mumbai → Goa:</p>
<ul>
<li><p>You pass through tolls</p>
</li>
<li><p>Each toll = hop (router)</p>
</li>
</ul>
<p>👉 These commands show:</p>
<p>“Which toll booths did my packet cross, and how long did each take?”</p>
<hr />
<p>What is a “hop”?</p>
<p>👉 A hop = one router in the path</p>
<p>Example:</p>
<pre><code class="language-plaintext">Your EC2 → Router 1 → Router 2 → Router 3 → Google
</code></pre>
<p>👉 That = <strong>4 hops</strong></p>
<p>Now your actual output</p>
<pre><code class="language-plaintext">1 → router (AWS)         ~6 ms
2 → * * *                (hidden)
3 → router               ~6 ms
4 → * * *                (hidden)
5 → google.com           ~6 ms ✅
</code></pre>
<h3>Biggest confusion: * * *</h3>
<p>You’re probably thinking:</p>
<p>“Something is broken?”</p>
<p>👉 NO.</p>
<p>It just means:</p>
<p>That router is <strong>not replying</strong></p>
<p>But your packet <strong>still passed through</strong></p>
<hr />
<h3>Real-world truth</h3>
<p>👉 Many routers (including those used by Google and cloud providers) <strong>block traceroute replies for security</strong></p>
<p>So:</p>
<ul>
<li><code>* * *</code> = <strong>hidden hop, not failure</strong></li>
</ul>
<h3>traceroute vs tracepath (simple difference)</h3>
<table>
<thead>
<tr>
<th>Feature</th>
<th>traceroute</th>
<th>tracepath</th>
</tr>
</thead>
<tbody><tr>
<td>Needs install</td>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<td>Detail level</td>
<td>More</td>
<td>Less</td>
</tr>
<tr>
<td>Output style</td>
<td>Complex</td>
<td>Cleaner</td>
</tr>
<tr>
<td>Use case</td>
<td>Deep debugging</td>
<td>Quick check</td>
</tr>
</tbody></table>
<p>👉 For above task: both are fine</p>
<hr />
<h3>What you actually need to understand (not overthink)</h3>
<p>You’re NOT expected to memorize routers.</p>
<p>You just need to answer:</p>
<ol>
<li>Did it reach destination?</li>
</ol>
<p>👉 YES</p>
<ol>
<li>How many hops?</li>
</ol>
<p>👉 ~5 hops</p>
<ol>
<li>Latency stable?</li>
</ol>
<p>👉 Yes (~6 ms)</p>
<ol>
<li>Any failures?</li>
</ol>
<p>👉 No (only ICMP filtering)</p>
<hr />
<h3>Path Observation</h3>
<ul>
<li><p>Network path consists of multiple hops (~5)</p>
</li>
<li><p>Latency remains stable (~6 ms) across hops</p>
</li>
<li><p>Some hops show <code>* * *</code> due to ICMP filtering (normal behavior)</p>
</li>
<li><p>Destination (<a href="http://google.com"><code>google.com</code></a>) is successfully reached</p>
</li>
</ul>
<p>Traceroute shows how packets travel through multiple routers (hops) to reach the destination, with some hops hidden due to security filtering.</p>
<p>Final clarity</p>
<p>👉 You are NOT tracing the exact road</p>
<p>👉 You are just getting a rough idea of the journey</p>
<hr />
<h3>4. Listening Ports</h3>
<pre><code class="language-plaintext">ss -tulpn
</code></pre>
<h3>What is <code>ss -tulpn</code> showing?</h3>
<p>👉 It shows:</p>
<blockquote>
<p>“Which ports are open and which services are listening on your system”</p>
</blockquote>
<p>Think of it like:</p>
<p>Your server = building<br />Ports = doors<br />Services = people waiting at doors</p>
<hr />
<h2>Focus only on IMPORTANT parts (ignore noise)</h2>
<p>You don’t need to understand every line. Just extract key ones</p>
<h3>Key lines from output</h3>
<h3>1️⃣ SSH (MOST IMPORTANT)</h3>
<pre><code class="language-plaintext">tcp LISTEN 0.0.0.0:22
</code></pre>
<p>👉 Port <strong>22 = SSH</strong></p>
<ul>
<li><p>This is how you connected to your EC2</p>
</li>
<li><p><code>0.0.0.0</code> → Accessible from all network interfaces (may still be restricted by firewall/security groups)</p>
</li>
</ul>
<hr />
<h2>2️⃣ DNS (local resolver)</h2>
<pre><code class="language-plaintext">127.0.0.53:53
127.0.0.54:53
</code></pre>
<p>👉 Port <strong>53 = DNS</strong></p>
<ul>
<li><p>Used for resolving domains (like <a href="http://google.com">google.com</a> → IP)</p>
</li>
<li><p>Running locally on your system</p>
</li>
</ul>
<hr />
<h2>3️⃣ DHCP</h2>
<pre><code class="language-plaintext">172.71.56.167:68
</code></pre>
<p>👉 Port 68 (DHCP client) used for IP assignment</p>
<hr />
<h2>4️⃣ NTP (time sync)</h2>
<pre><code class="language-plaintext">127.0.0.1:323
</code></pre>
<p>👉 Port <strong>323 = NTP</strong></p>
<ul>
<li>Keeps system time synced</li>
</ul>
<hr />
<h2>5️⃣ Custom / unknown ports</h2>
<pre><code class="language-plaintext">4330
44321
44322
44323
46283
</code></pre>
<p>👉 These are:</p>
<ul>
<li><p>Temporary / custom services</p>
</li>
<li><p>Could be:</p>
<ul>
<li><p>apps</p>
</li>
<li><p>background services</p>
</li>
<li><p>ephemeral ports</p>
</li>
</ul>
</li>
</ul>
<hr />
<h3>Important concepts</h3>
<h3>🔹 LISTEN means:</h3>
<p>👉 Service is <strong>waiting for connections</strong></p>
<hr />
<h2>🔹 TCP vs UDP</h2>
<ul>
<li><p><code>tcp</code> → reliable (SSH, HTTP)</p>
</li>
<li><p><code>udp</code> → fast (DNS, DHCP)</p>
</li>
</ul>
<hr />
<h2>🔹 0.0.0.0 vs 127.0.0.1</h2>
<table>
<thead>
<tr>
<th>Address</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>0.0.0.0</td>
<td>Accessible from anywhere</td>
</tr>
<tr>
<td>127.0.0.1</td>
<td>Only inside machine</td>
</tr>
</tbody></table>
<hr />
<h2>Ports &amp; Services Observation</h2>
<ul>
<li><p>SSH service is running on port 22 and listening on all interfaces</p>
</li>
<li><p>DNS resolver is active on port 53 (localhost)</p>
</li>
<li><p>DHCP client is using port 68 for IP assignment</p>
</li>
<li><p>NTP service is running on port 323 for time synchronization</p>
</li>
<li><p>Multiple custom ports are listening, indicating background or application services</p>
</li>
</ul>
<hr />
<blockquote>
<p>Multiple services are listening on different ports including SSH (22), DNS (53), and DHCP (68), confirming active network services on the system.</p>
</blockquote>
<hr />
<h3>Simple clarity</h3>
<ul>
<li><p>Port 22 → admin entry (SSH)</p>
</li>
<li><p>Port 53 → phonebook (DNS)</p>
</li>
<li><p>Port 68 → address assignment (DHCP)</p>
</li>
<li><p>Other ports → internal apps</p>
</li>
</ul>
<hr />
<h3>About <code>netstat</code></h3>
<p>You saw:</p>
<pre><code class="language-plaintext">ubuntu@ip-172-71-56-167:~$ netstat -tulpn (No info could be read for "-p": geteuid()=1000 but you should be root.)
</code></pre>
<p>👉 Because you didn’t use <code>sudo</code></p>
<p>If you run:</p>
<pre><code class="language-plaintext">sudo netstat -tulpn
</code></pre>
<p>👉 You’ll see process names too</p>
<hr />
<p><strong>Observations:</strong></p>
<p>Real ports from your system:</p>
<table>
<thead>
<tr>
<th>Port</th>
<th>Service (Interpretation)</th>
<th>Notes</th>
</tr>
</thead>
<tbody><tr>
<td>22</td>
<td>SSH</td>
<td>Remote login to your EC2</td>
</tr>
<tr>
<td>53</td>
<td>DNS resolver</td>
<td>Local DNS (systemd-resolved)</td>
</tr>
<tr>
<td>68</td>
<td>DHCP</td>
<td>IP assignment from network</td>
</tr>
<tr>
<td>323</td>
<td>NTP</td>
<td>Time sync service</td>
</tr>
<tr>
<td>4330</td>
<td>Custom service</td>
<td>Some app running</td>
</tr>
<tr>
<td>44321–44323</td>
<td>Custom ports</td>
<td>Likely app / ephemeral services</td>
</tr>
<tr>
<td>46283</td>
<td>Local process</td>
<td>Internal app (localhost only)</td>
</tr>
</tbody></table>
<p><strong>Ports &amp; Services Observation:</strong></p>
<ul>
<li><p>Port <strong>22</strong> is open → SSH service is running (remote access)</p>
</li>
<li><p>Port <strong>53</strong> is open → local DNS resolver active</p>
</li>
<li><p>Port <strong>68 (UDP)</strong> → DHCP client (IP assignment)</p>
</li>
<li><p>Port <strong>323 (UDP)</strong> → NTP (time sync)</p>
</li>
<li><p>Ports <strong>4330, 44321–44323</strong> → custom/local services running</p>
</li>
<li><p>Port <strong>46283</strong> → local application bound to localhost</p>
</li>
</ul>
<p>👉 No standard web ports (80/443) were observed, meaning no web server is currently running.</p>
<hr />
<h3>5. DNS Resolution</h3>
<pre><code class="language-plaintext">dig google.com
</code></pre>
<h3>What just happened</h3>
<p>You asked:</p>
<pre><code class="language-plaintext">dig google.com
</code></pre>
<p>👉 Your system asked a DNS server:</p>
<blockquote>
<p>“What is the IP of google.com?”</p>
</blockquote>
<p>👉 DNS replied:</p>
<blockquote>
<p>“It is <strong>142.250.69.174</strong>”</p>
</blockquote>
<hr />
<h3>Understanding output</h3>
<h3>✅ 1. The important answer</h3>
<pre><code class="language-plaintext">google.com.   82   IN   A   142.250.69.174
</code></pre>
<p>👉 Meaning:</p>
<ul>
<li><p><a href="http://google.com"><code>google.com</code></a> → domain name</p>
</li>
<li><p><code>A</code> record → IPv4 address</p>
</li>
<li><p><code>142.250.69.174</code> → actual IP</p>
</li>
</ul>
<hr />
<h3>✅ 2. Query time</h3>
<pre><code class="language-plaintext">Query time: 2 msec
</code></pre>
<p>👉 DNS responded in <strong>2 milliseconds</strong></p>
<p>✔ Very fast</p>
<p>✔ DNS is healthy</p>
<hr />
<h3>✅ 3. Which DNS server answered?</h3>
<pre><code class="language-plaintext">SERVER: 127.0.0.53#53
</code></pre>
<p>👉 This is important:</p>
<ul>
<li><p><code>127.0.0.53</code> = <strong>local DNS resolver</strong> (systemd-resolved)</p>
</li>
<li><p>Your system didn’t directly ask Google DNS (8.8.8.8)</p>
</li>
<li><p>It asked a <strong>local service</strong>, which then resolved it</p>
</li>
</ul>
<hr />
<h3>✅ 4. From <code>nslookup</code></h3>
<pre><code class="language-plaintext">Address: 142.250.69.174   (IPv4)
Address: 2607:f8b0:400a:801::200e   (IPv6)
</code></pre>
<p>👉 This shows:</p>
<ul>
<li><p>Google has <strong>multiple IPs</strong></p>
</li>
<li><p>IPv4 + IPv6</p>
</li>
</ul>
<hr />
<h3>Key concept</h3>
<p>👉 DNS can return:</p>
<ul>
<li><p>One IP ✅</p>
</li>
<li><p>Multiple IPs ✅ (load balancing)</p>
</li>
</ul>
<p>Google often rotates IPs depending on location.</p>
<hr />
<p><strong>DNS Resolution Observation:</strong></p>
<ul>
<li><p><a href="http://google.com"><code>google.com</code></a> resolved to IP <strong>142.250.69.174</strong></p>
</li>
<li><p>Query time was <strong>~2 ms</strong>, indicating fast DNS response</p>
</li>
<li><p>Resolver used: <strong>127.0.0.53</strong> (local system DNS)</p>
</li>
<li><p><code>nslookup</code> also returned an <strong>IPv6 address</strong>, showing dual-stack support</p>
</li>
<li><p>Confirms DNS resolution is working correctly</p>
</li>
</ul>
<hr />
<h3>Analogy</h3>
<p>Think of DNS like a <strong>phonebook</strong>:</p>
<ul>
<li><p>You search: “google.com”</p>
</li>
<li><p>DNS gives: “📞 142.250.69.174”</p>
</li>
</ul>
<p>👉 Your system can’t call names — it calls <strong>IP addresses</strong></p>
<hr />
<h3>Insight</h3>
<p>👉 “The system uses a local DNS resolver (127.0.0.53), which forwards queries instead of directly contacting external DNS servers.”</p>
<hr />
<h3>6. HTTP / HTTPS Check</h3>
<pre><code class="language-plaintext">curl -I https://google.com
</code></pre>
<h3>What you did</h3>
<pre><code class="language-plaintext">curl -I https://google.com
</code></pre>
<p>👉 You asked:</p>
<blockquote>
<p>“Hey server, just give me the <strong>headers</strong>, not the full page.”</p>
</blockquote>
<hr />
<h3>Step-by-step understanding</h3>
<h3>✅ First response</h3>
<pre><code class="language-plaintext">HTTP/2 301
location: https://www.google.com/
</code></pre>
<p>👉 Meaning:</p>
<ul>
<li><p><strong>301 = Redirect</strong></p>
</li>
<li><p>Google is saying:</p>
</li>
</ul>
<blockquote>
<p>“Go to 👉 <a href="https://www.google.com">https://www.google.com</a> instead”</p>
</blockquote>
<hr />
<h3>✅ When you used <code>-IL</code></h3>
<pre><code class="language-plaintext">curl -IL https://google.com
</code></pre>
<p>👉 This follows redirects automatically</p>
<h3>🔹 First response (same as before)</h3>
<pre><code class="language-plaintext">HTTP/2 301
location: https://www.google.com/
</code></pre>
<h3>🔹 Second response (final)</h3>
<pre><code class="language-plaintext">HTTP/2 200
</code></pre>
<p>👉 Meaning:</p>
<ul>
<li><p><strong>200 = OK</strong></p>
</li>
<li><p>Final page successfully loaded</p>
</li>
</ul>
<h3>What this tells you</h3>
<p>This single command confirms:</p>
<p>✅ DNS is working</p>
<p>✅ TCP connection is working</p>
<p>✅ TLS (HTTPS) is working</p>
<p>✅ Server is reachable</p>
<p>✅ Application is responding</p>
<h3>Real-world analogy</h3>
<p>Think of this like visiting a shop:</p>
<ol>
<li><p>You go to: <a href="http://google.com"><code>google.com</code></a></p>
</li>
<li><p>Shop says:<br />👉 “We moved → go to <a href="http://www.google.com%E2%80%9D">www.google.com”</a> (301)</p>
</li>
<li><p>You go there</p>
</li>
<li><p>Shop opens door<br />👉 “Welcome” (200 OK)</p>
</li>
</ol>
<hr />
<h3>Important headers (simple meaning)</h3>
<p>You don’t need all, just key ones:</p>
<h3>✅ <code>location</code></h3>
<p>→ redirect URL</p>
<h3>✅ <code>server: gws</code></h3>
<p>→ Google Web Server</p>
<h3>✅ <code>set-cookie</code></h3>
<p>→ browser session/cookies being set</p>
<h3>✅ <code>cache-control</code></h3>
<p>→ how response should be cached</p>
<hr />
<h3>HTTP Check Observation:</h3>
<ul>
<li><p>Initial request returned <strong>301 redirect</strong> to <a href="https://www.google.com"><code>https://www.google.com</code></a></p>
</li>
<li><p>Final response returned <strong>200 OK</strong>, confirming successful request</p>
</li>
<li><p>Response uses <strong>HTTP/2</strong></p>
</li>
<li><p>Headers include cookies, cache-control, and security policies</p>
</li>
<li><p>Confirms application layer (HTTP/HTTPS) is working correctly</p>
</li>
</ul>
<hr />
<p>👉 “Using <code>curl -IL</code> helps trace full request flow including redirects and final response.”</p>
<p>👉 “<code>curl -I</code> quickly verifies application-layer health without downloading full content.”</p>
<hr />
<h3>7. Connections Snapshot</h3>
<pre><code class="language-plaintext">netstat -an | head
</code></pre>
<h3>What this command shows</h3>
<pre><code class="language-plaintext">netstat -an | head
Active Internet connections (servers and established) 
Proto Recv-Q Send-Q Local Address Foreign Address State 
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:4330 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:44322 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:44323 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:44321 0.0.0.0:* LISTEN 
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 
tcp 0 0 127.0.0.1:46283 0.0.0.0:* LISTEN 
ubuntu@ip-172-71-56-167:~$
</code></pre>
<p>👉 It gives a <strong>snapshot of network connections</strong></p>
<ul>
<li><p><code>LISTEN</code> → waiting for connections</p>
</li>
<li><p><code>ESTABLISHED</code> → active communication</p>
</li>
</ul>
<hr />
<h3>Your output (what it actually means)</h3>
<p>You got only:</p>
<pre><code class="language-plaintext">LISTEN
</code></pre>
<p>👉 That means:</p>
<blockquote>
<p>Your system currently has <strong>services waiting</strong>, but <strong>no active connections at that exact moment</strong></p>
</blockquote>
<hr />
<p>Example:</p>
<pre><code class="language-plaintext">tcp  0  0  0.0.0.0:22  0.0.0.0:*  LISTEN
</code></pre>
<p>👉 Breakdown:</p>
<ul>
<li><p><code>tcp</code> → protocol</p>
</li>
<li><p><code>0.0.0.0:22</code> → listening on <strong>all IPs</strong>, port 22</p>
</li>
<li><p><code>LISTEN</code> → waiting for incoming SSH connections</p>
</li>
</ul>
<hr />
<h3>What you should notice</h3>
<p>From your output:</p>
<ul>
<li><p>Multiple ports are in <strong>LISTEN state</strong></p>
</li>
<li><p>No <code>ESTABLISHED</code> connections in first few lines</p>
</li>
</ul>
<p>👉 Meaning:</p>
<p>✔ Server is ready</p>
<p>❌ No active traffic (at that moment)</p>
<hr />
<h3>Important detail</h3>
<p>You used:</p>
<pre><code class="language-plaintext">head
</code></pre>
<p>👉 So you only saw <strong>top lines</strong>, not full output</p>
<p>👉 No active connections visible in the shown output (full output may differ)</p>
<p>👉 There <em>might be</em> <code>ESTABLISHED</code> connections below</p>
<hr />
<h3>Connections Snapshot Observation:</h3>
<ul>
<li><p>Multiple services are in <strong>LISTEN state</strong> (ports 22, 53, 4330, 44321–44323)</p>
</li>
<li><p>No <code>ESTABLISHED</code> connections observed in the first few lines</p>
</li>
<li><p>Indicates system is ready to accept connections but no active sessions at that moment</p>
</li>
<li><p>Output is truncated (<code>head</code>), so full connection state may include more entries</p>
</li>
</ul>
<hr />
<h3>Simple analogy</h3>
<p>Think of this like:</p>
<ul>
<li><p><strong>LISTEN</strong> → shop is open, waiting for customer</p>
</li>
<li><p><strong>ESTABLISHED</strong> → customers inside the shop</p>
</li>
</ul>
<p>👉 Your shop is open, but currently empty</p>
<hr />
<p>👉 “<code>netstat -an</code> provides a quick snapshot of system networking state, useful to detect active vs idle connections.”</p>
<hr />
<h3>What is <code>nc -zv</code> ?</h3>
<p>Command:</p>
<pre><code class="language-plaintext">nc -zv localhost 22
</code></pre>
<h3>Meaning:</h3>
<ul>
<li><p><code>nc</code> = Netcat (network testing tool)</p>
</li>
<li><p><code>-z</code> = <strong>just check port (don’t send data)</strong></p>
</li>
<li><p><code>-v</code> = <strong>show result clearly (verbose)</strong></p>
</li>
</ul>
<p>👉 In simple words:</p>
<blockquote>
<p>“Check if this port is open and reachable”</p>
</blockquote>
<hr />
<h3>Your Result:</h3>
<pre><code class="language-plaintext">Connection to localhost (127.0.0.1) 22 port [tcp/ssh] succeeded!
</code></pre>
<h3>Meaning:</h3>
<p>✔ Port 22 is open</p>
<p>✔ SSH service is working</p>
<p>✔ You can connect to it</p>
<hr />
<p>Next: <a href="https://90-days-devops-with-shubham.hashnode.dev/day-14f-mini-task-port-probe-interpretation">https://90-days-devops-with-shubham.hashnode.dev/day-14f-mini-task-port-probe-interpretation</a></p>
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 14d –What Really Happens When You Hit a URL (Step-by-Step)]]></title><description><![CDATA[This is Part 4 of the Networking for DevOps series.
https://90-days-devops-with-shubham.hashnode.dev/day-14c-where-http-tcp-ip-actually-sit-layer-mapping-simplified
What Actually Happens in Background]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-14d-what-really-happens-when-you-hit-a-url-step-by-step</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-14d-what-really-happens-when-you-hit-a-url-step-by-step</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sun, 19 Apr 2026 14:23:07 GMT</pubDate><content:encoded><![CDATA[<h3>This is Part 4 of the Networking for DevOps series.</h3>
<p><a href="https://90-days-devops-with-shubham.hashnode.dev/day-14c-where-http-tcp-ip-actually-sit-layer-mapping-simplified">https://90-days-devops-with-shubham.hashnode.dev/day-14c-where-http-tcp-ip-actually-sit-layer-mapping-simplified</a></p>
<h2>What Actually Happens in Background</h2>
<p>When you run:</p>
<pre><code class="language-plaintext">curl https://google.com
</code></pre>
<h3>Step 1: DNS Lookup → domain → IP</h3>
<ul>
<li>Converts <a href="http://google.com"><code>google.com</code></a> → IP address</li>
</ul>
<h3>Step 2: ARP (Local Network)</h3>
<ul>
<li>Finds MAC address of your router</li>
</ul>
<h3>Step 3: TCP Handshake</h3>
<pre><code class="language-plaintext">SYN → SYN-ACK → ACK
</code></pre>
<h3>Step 4: TLS Handshake</h3>
<ul>
<li>Secure encrypted connection established</li>
</ul>
<h3>Step 5: HTTP Request</h3>
<pre><code class="language-plaintext">GET /
</code></pre>
<h3>Step 6: Response</h3>
<ul>
<li>Server sends response back</li>
</ul>
<hr />
<p>Next: <a href="https://90-days-devops-with-shubham.hashnode.dev/day-14e-how-to-debug-network-issues-like-a-devops-engineer">https://90-days-devops-with-shubham.hashnode.dev/day-14e-how-to-debug-network-issues-like-a-devops-engineer</a></p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 14c –Where HTTP, TCP, IP Actually Sit (Layer Mapping Simplified)]]></title><description><![CDATA[This is Part 3 of the Networking for DevOps series.
In the previous part, we understood https://90-days-devops-with-shubham.hashnode.dev/day-14b-tcp-and-udp
Core Concepts
OSI vs TCP/IP (In Simple Word]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-14c-where-http-tcp-ip-actually-sit-layer-mapping-simplified</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-14c-where-http-tcp-ip-actually-sit-layer-mapping-simplified</guid><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sun, 19 Apr 2026 14:16:44 GMT</pubDate><content:encoded><![CDATA[<h3>This is Part 3 of the Networking for DevOps series.</h3>
<p>In the previous part, we understood <a href="https://90-days-devops-with-shubham.hashnode.dev/day-14b-tcp-and-udp">https://90-days-devops-with-shubham.hashnode.dev/day-14b-tcp-and-udp</a></p>
<h2>Core Concepts</h2>
<h3>OSI vs TCP/IP (In Simple Words)</h3>
<p><strong>OSI (7 layers)</strong> → Conceptual framework for understanding networking</p>
<blockquote>
<p>(Physical → Data Link → Network → Transport → Session → Presentation → Application)</p>
</blockquote>
<ul>
<li><p><strong>L7 Application</strong> → User-facing protocols (HTTP, DNS, FTP)</p>
</li>
<li><p><strong>L6 Presentation</strong> → Data formatting, encryption concepts (mapped to application layer in TCP/IP)</p>
</li>
<li><p><strong>L5 Session</strong> → Manages communication sessions between systems</p>
</li>
<li><p><strong>L4 Transport</strong> → TCP (reliable), UDP (fast)</p>
</li>
<li><p><strong>L3 Network</strong> → IP addressing &amp; routing</p>
</li>
<li><p><strong>L2 Data Link</strong> → MAC, Ethernet frames</p>
</li>
<li><p><strong>L1 Physical</strong> → Cables, Wi-Fi signals</p>
</li>
</ul>
<h3>Mapping:</h3>
<table>
<thead>
<tr>
<th><strong>OSI Layer (7)</strong></th>
<th><strong>OSI Layer Name</strong></th>
<th><strong>TCP/IP Layer (4)</strong></th>
<th><strong>Key Concepts / Protocols</strong></th>
</tr>
</thead>
<tbody><tr>
<td>7</td>
<td>Application</td>
<td><strong>Application</strong></td>
<td>HTTP, HTTPS, FTP, SMTP, DNS</td>
</tr>
<tr>
<td>6</td>
<td>Presentation</td>
<td><strong>Application</strong></td>
<td>SSL/TLS, Encryption, Compression</td>
</tr>
<tr>
<td>5</td>
<td>Session</td>
<td><strong>Application</strong></td>
<td>Session Management</td>
</tr>
<tr>
<td>4</td>
<td>Transport</td>
<td><strong>Transport</strong></td>
<td>TCP, UDP</td>
</tr>
<tr>
<td>3</td>
<td>Network</td>
<td><strong>Internet</strong></td>
<td>IP, ICMP, IPSec</td>
</tr>
<tr>
<td>2</td>
<td>Data Link</td>
<td><strong>Network/Link</strong></td>
<td>Ethernet, VLAN, MAC (ARP bridges L2–L3)</td>
</tr>
<tr>
<td>1</td>
<td>Physical</td>
<td><strong>Network/Link</strong></td>
<td>Cables, NIC, Signals, WiFi</td>
</tr>
</tbody></table>
<p><strong>TCP/IP (4 layers)</strong> → Practical model used in real networks</p>
<blockquote>
<p><em>Link → Internet → Transport → Application</em></p>
</blockquote>
<table>
<thead>
<tr>
<th>OSI Layers</th>
<th>TCP/IP Layer</th>
<th>Examples</th>
</tr>
</thead>
<tbody><tr>
<td>L7–L5</td>
<td>Application</td>
<td>HTTP, HTTPS, DNS, TLS</td>
</tr>
<tr>
<td>L4</td>
<td>Transport</td>
<td>TCP, UDP</td>
</tr>
<tr>
<td>L3</td>
<td>Internet</td>
<td>IP, ICMP</td>
</tr>
<tr>
<td>L2-L1</td>
<td>Link</td>
<td>Ethernet, Wi-Fi</td>
</tr>
</tbody></table>
<p><strong>Key Difference:</strong></p>
<ul>
<li><p>OSI is for learning;</p>
</li>
<li><p>TCP/IP is what actually runs the internet.</p>
</li>
</ul>
<hr />
<h2>Protocol Placement - Where Things Sit</h2>
<p><strong>Where IP, TCP/UDP, HTTP/HTTPS, DNS sit in the stack</strong></p>
<table>
<thead>
<tr>
<th><strong>Protocol</strong></th>
<th><strong>Layer</strong></th>
</tr>
</thead>
<tbody><tr>
<td>IP</td>
<td>Internet Layer (OSI L3)</td>
</tr>
<tr>
<td>TCP/UDP</td>
<td>Transport Layer (OSI L4)</td>
</tr>
<tr>
<td>HTTP,HTTPS,DNS</td>
<td>Application Layer</td>
</tr>
<tr>
<td>DNS</td>
<td>Application Layer (uses UDP/TCP 53)</td>
</tr>
</tbody></table>
<h4><strong>Example:</strong></h4>
<pre><code class="language-plaintext">curl https://www.google.com = App layer over TCP over IP
</code></pre>
<ul>
<li><p>Layer 7 (Application): curl creates the HTTP request (GET /index.html).</p>
</li>
<li><p>Layer 6 (Presentation): Encrypts the data with SSL/TLS (handled within application layer in TCP/IP model).</p>
</li>
<li><p>Layer 5 (Session): Manages connection state (handled mostly by application/TCP in real systems)</p>
</li>
<li><p>Layer 4 (Transport): Wraps in TCP for reliability (Port 54321 -&gt; 443).</p>
</li>
<li><p>Layer 3 (Network): Adds IP addressing (Src: 192.168.1.100 -&gt; Dst: 93.184.216.43).</p>
</li>
<li><p>Layer 2 (Data Link): Adds MAC addresses for the local router.</p>
</li>
<li><p>Layer 1 (Physical): onverts data into electrical signals or radio waves for transmission</p>
</li>
</ul>
<p>This is:</p>
<pre><code class="language-plaintext">Application (HTTP)
    ↓
Transport (TCP)
    ↓
Internet (IP)
    ↓
Link (MAC/ARP)
</code></pre>
<hr />
<p>Next: <a href="https://90-days-devops-with-shubham.hashnode.dev/day-14d-what-really-happens-when-you-hit-a-url-step-by-step">https://90-days-devops-with-shubham.hashnode.dev/day-14d-what-really-happens-when-you-hit-a-url-step-by-step</a></p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 14b –TCP and UDP]]></title><description><![CDATA[This is Part 2 of the Networking for DevOps series.
In the previous part, we understood https://90-days-devops-with-shubham.hashnode.dev/day-14a-networking-fundamentals
Now, let’s see how data is actu]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-14b-tcp-and-udp</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-14b-tcp-and-udp</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sun, 19 Apr 2026 14:15:02 GMT</pubDate><content:encoded><![CDATA[<h3>This is Part 2 of the Networking for DevOps series.</h3>
<p>In the previous part, we understood <a href="https://90-days-devops-with-shubham.hashnode.dev/day-14a-networking-fundamentals">https://90-days-devops-with-shubham.hashnode.dev/day-14a-networking-fundamentals</a></p>
<p>Now, let’s see how data is actually delivered using TCP and UDP.</p>
<hr />
<h2>What is TCP?</h2>
<h3>TCP (Transmission Control Protocol)</h3>
<p>TCP is basically the <strong>“reliable delivery system” of the internet</strong>.</p>
<p>Let’s make it simple</p>
<p>Think of TCP like a <strong>Courier with tracking</strong></p>
<p>When you send something (message, file, request), TCP makes sure:</p>
<p>✔ It reaches the destination<br />✔ It arrives in correct order<br />✔ Nothing is missing<br />✔ If something is lost → it is re-sent</p>
<h3>TCP Internal Flow</h3>
<ol>
<li><p>Prepares delivery with tracking</p>
</li>
<li><p>Adds sequence numbers</p>
</li>
<li><p>Travels across network</p>
</li>
<li><p>Receiver rebuilds message</p>
</li>
<li><p>Missing parts are resent</p>
</li>
<li><p>Final message is correct</p>
</li>
</ol>
<hr />
<h3>Example:</h3>
<p>You send:</p>
<blockquote>
<p>“Order pizza at 8 PM”</p>
</blockquote>
<hr />
<h2>TCP does this behind the scenes</h2>
<h3>1. It prepares delivery with tracking system</h3>
<p>TCP says:</p>
<ul>
<li><p>“I will deliver this message safely”</p>
</li>
<li><p>“I will track everything properly”</p>
</li>
</ul>
<hr />
<h3>2. It adds hidden order numbers (not visible to you)</h3>
<p>Instead of breaking it like physical pieces, TCP:</p>
<ul>
<li><p>tags data with <strong>sequence numbers</strong></p>
</li>
<li><p>so receiver knows the exact order</p>
</li>
</ul>
<p>Think:</p>
<blockquote>
<p>like numbered pages in a notebook</p>
</blockquote>
<hr />
<h3>3. Message travels through internet</h3>
<ul>
<li><p>Data moves across routers</p>
</li>
<li><p>May take different paths</p>
</li>
<li><p>Still tracked in background</p>
</li>
</ul>
<hr />
<h3>4. Receiver rebuilds message</h3>
<p>Receiver gets data like:</p>
<ul>
<li><p>“Order”</p>
</li>
<li><p>“pizza”</p>
</li>
<li><p>“at”</p>
</li>
<li><p>“8 PM”</p>
</li>
</ul>
<p>Even if it arrives mixed up, TCP:</p>
<ul>
<li>rearranges using sequence numbers ✔</li>
</ul>
<p>So final message becomes:</p>
<blockquote>
<p>“Order pizza at 8 PM”</p>
</blockquote>
<hr />
<h3>5. If something is missing</h3>
<p>If “8 PM” part is missing:</p>
<ul>
<li><p>receiver says: “send that part again”</p>
</li>
<li><p>sender resends ONLY missing part</p>
</li>
</ul>
<hr />
<h3>6. ✔ Final result</h3>
<p>Message is complete, correct, and in order.</p>
<hr />
<h3>TCP = Reliable system</h3>
<pre><code class="language-text">Send message → Label data → Transmit → Rearrange 
→ Fix missing → Deliver correct message
</code></pre>
<hr />
<blockquote>
<p>TCP = “Even if data arrives messy, system fixes it and guarantees correct message”</p>
</blockquote>
<h3>TCP = “Safe delivery mode”</h3>
<pre><code class="language-plaintext">You → Internet → Friend

✔ No loss  
✔ No corruption  
✔ Correct order  
✔ Guaranteed delivery
</code></pre>
<hr />
<h2>Real-world analogy (TCP)</h2>
<table>
<thead>
<tr>
<th>Real life</th>
<th>TCP meaning</th>
</tr>
</thead>
<tbody><tr>
<td>Courier with tracking</td>
<td>TCP</td>
</tr>
<tr>
<td>Registered post</td>
<td>TCP</td>
</tr>
<tr>
<td>Call and confirm delivery</td>
<td>TCP</td>
</tr>
<tr>
<td>Throw and forget</td>
<td>❌ NOT TCP</td>
</tr>
</tbody></table>
<hr />
<h3>TCP used in real world</h3>
<p>✔ WhatsApp messages</p>
<p>✔ SSH (port 22)</p>
<p>✔ HTTPS websites (port 443)</p>
<p>✔ <code>curl</code> requests</p>
<p>✔ File downloads</p>
<hr />
<h2>What is UDP?</h2>
<p>UDP is the <strong>“fast but no guarantee system”</strong></p>
<p>Think of it like a <strong>Live Cricket Score update system</strong></p>
<hr />
<h3>UDP (User Datagram Protocol)</h3>
<p>👉 UDP = “send and forget”</p>
<p>You:</p>
<ul>
<li><p>Send data</p>
</li>
<li><p>Don’t wait</p>
</li>
<li><p>Don’t confirm</p>
</li>
<li><p>Don’t resend</p>
</li>
</ul>
<hr />
<h3>Live Cricket Score example (UDP)</h3>
<p>Imagine watching IPL score:</p>
<ul>
<li><p>6 runs update → shown instantly</p>
</li>
<li><p>Next ball update → comes next</p>
</li>
<li><p>If one update is missed → NO problem</p>
</li>
</ul>
<p>👉 You don’t care about old missing updates</p>
<p>👉 You only care about <strong>latest score</strong></p>
<p>That’s UDP</p>
<hr />
<h3>UDP flow (simple)</h3>
<pre><code class="language-plaintext">Server → sends updates → You watch

✔ Fast  
❌ No guarantee all packets arrive  
❌ No retry  
❌ No order guarantee needed
</code></pre>
<hr />
<h3>Real-world analogy (UDP)</h3>
<table>
<thead>
<tr>
<th>Real life</th>
<th>UDP meaning</th>
</tr>
</thead>
<tbody><tr>
<td>Live cricket score</td>
<td>UDP</td>
</tr>
<tr>
<td>Video call</td>
<td>UDP</td>
</tr>
<tr>
<td>Online gaming</td>
<td>UDP</td>
</tr>
<tr>
<td>Streaming video</td>
<td>UDP</td>
</tr>
</tbody></table>
<h2>Why UDP is used</h2>
<p>Because:</p>
<blockquote>
<p>SPEED &gt; PERFECT DELIVERY</p>
</blockquote>
<p>Even if something is missing → system continues</p>
<hr />
<h3>TCP vs UDP (super simple)</h3>
<table>
<thead>
<tr>
<th>Feature</th>
<th>TCP</th>
<th>UDP</th>
</tr>
</thead>
<tbody><tr>
<td>Delivery</td>
<td>Guaranteed</td>
<td>Not guaranteed</td>
</tr>
<tr>
<td>Order</td>
<td>Maintained</td>
<td>Not maintained</td>
</tr>
<tr>
<td>Speed</td>
<td>Slower</td>
<td>Faster</td>
</tr>
<tr>
<td>Retry</td>
<td>Yes</td>
<td>No</td>
</tr>
</tbody></table>
<hr />
<ul>
<li><p>TCP = Courier (safe, tracked, confirmed)</p>
</li>
<li><p>UDP = Live cricket score (fast, no guarantee)</p>
</li>
</ul>
<pre><code class="language-plaintext">TCP → “Make sure it arrives correctly” 
UDP → “Send fast updates, don’t worry if something drops” 
</code></pre>
<hr />
<p>Next: <a href="https://90-days-devops-with-shubham.hashnode.dev/day-14c-where-http-tcp-ip-actually-sit-layer-mapping-simplified">https://90-days-devops-with-shubham.hashnode.dev/day-14c-where-http-tcp-ip-actually-sit-layer-mapping-simplified</a></p>
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 14a – Networking Fundamentals]]></title><description><![CDATA[Today I practiced networking fundamentals + real troubleshooting workflows across:

Local machine

EC2 instances

External targets like google.com, github.com, and custom domains


👉 In a real-world,]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-14a-networking-fundamentals</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-14a-networking-fundamentals</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sun, 19 Apr 2026 10:05:29 GMT</pubDate><content:encoded><![CDATA[<p>Today I practiced <strong>networking fundamentals</strong> <strong>+</strong> <strong>real troubleshooting workflows</strong> across:</p>
<ul>
<li><p>Local machine</p>
</li>
<li><p>EC2 instances</p>
</li>
<li><p>External targets like <code>google.com</code>, <code>github.com</code>, and custom domains</p>
</li>
</ul>
<p>👉 In a real-world, DevOps-style environment</p>
<hr />
<h2>Why This Matters</h2>
<p>Most people learn networking as theory — OSI layers, TCP/IP, protocols — but struggle when something actually breaks.</p>
<p>In real DevOps work, nobody asks:</p>
<blockquote>
<p>“What is Layer 4?”</p>
</blockquote>
<p>They ask:</p>
<blockquote>
<p>“Why is my service down?”</p>
</blockquote>
<hr />
<h2>What is OSI?</h2>
<p>OSI is a way to understand how networks work in layers.</p>
<p>It stands for <strong>Open Systems Interconnection model</strong>.</p>
<p>Think of it like a stack of 7 steps your request passes through when you do something like:</p>
<blockquote>
<p>Open WhatsApp</p>
</blockquote>
<hr />
<h3>WhatsApp Message — What REALLY happens behind the scenes</h3>
<p>You send:</p>
<blockquote>
<p>“Hey”</p>
</blockquote>
<h3>1. Your phone prepares the message (Application Layer)</h3>
<p>WhatsApp first:</p>
<ul>
<li><p>Converts “Hey” → data (binary)</p>
</li>
<li><p>Encrypts it (locks it )</p>
</li>
</ul>
<p>👉 Now it becomes a <strong>secure message</strong></p>
<p>Meaning:</p>
<blockquote>
<p>“I want to send something safely”</p>
</blockquote>
<hr />
<h3>2. Message becomes a packet (Transport Layer starts)</h3>
<p>Now WhatsApp wraps it like a parcel:</p>
<ul>
<li><p>Who sent it</p>
</li>
<li><p>Who should receive it</p>
</li>
<li><p>The encrypted message</p>
</li>
</ul>
<p>👉 This is called a <strong>packet</strong></p>
<p>Meaning:</p>
<blockquote>
<p>“Package the message properly for delivery”</p>
</blockquote>
<hr />
<h3>3. Finding destination (DNS + Network Layer)</h3>
<p>Before sending, your phone asks:</p>
<blockquote>
<p>“Where is WhatsApp / friend’s server?”</p>
</blockquote>
<p>This is like:</p>
<ul>
<li><code>dig google.com</code></li>
</ul>
<p>It returns an <strong>IP address</strong></p>
<p>Meaning:</p>
<blockquote>
<p>“Find the address before sending”</p>
</blockquote>
<h3>4. Packet travels through internet (Network path)</h3>
<p>Now your message moves:</p>
<ul>
<li><p>Phone → WiFi / mobile data</p>
</li>
<li><p>ISP (internet provider)</p>
</li>
<li><p>Routers (traffic system)</p>
</li>
<li><p>WhatsApp server</p>
</li>
</ul>
<p>👉 Like courier hubs delivering a parcel</p>
<p>Meaning:</p>
<blockquote>
<p>“Move data across the world”</p>
</blockquote>
<h3>5. WhatsApp server (middleman)</h3>
<p>Server:</p>
<ul>
<li><p>Does NOT read the message</p>
</li>
<li><p>Only forwards it</p>
</li>
</ul>
<p>👉 It finds your friend’s active device</p>
<p>Meaning:</p>
<blockquote>
<p>“Just deliver, didn’t open”</p>
</blockquote>
<h3>6. Friend receives message</h3>
<p>Friend’s phone:</p>
<ul>
<li><p>Gets packet</p>
</li>
<li><p>Unlocks it (decrypts)</p>
</li>
<li><p>Shows: “Hey”</p>
</li>
</ul>
<h3>7. Confirmation (TCP + reliability)</h3>
<p>Friend’s phone sends back:</p>
<blockquote>
<p>“Received”</p>
</blockquote>
<p>That’s why you see ✔✔ (blue ticks)</p>
<p>Meaning:</p>
<blockquote>
<p>“Delivery confirmed”</p>
</blockquote>
<h3>When WhatsApp sends message:</h3>
<pre><code class="language-plaintext">You (App Layer)
   ↓
Encrypt + Pack (Transport)
   ↓
Find Address (DNS / Network)
   ↓
Travel Internet (Routers)
   ↓
Server (Middleman)
   ↓
Friend (Receive + Decrypt)
   ↓
Confirm
</code></pre>
<blockquote>
<p>WhatsApp = type → lock → address → travel → deliver → unlock → confirm</p>
</blockquote>
<hr />
<h3>This is part 1 of the Networking for DevOps series.</h3>
<p>Next: <a href="https://90-days-devops-with-shubham.hashnode.dev/day-14b-tcp-and-udp">https://90-days-devops-with-shubham.hashnode.dev/day-14b-tcp-and-udp</a></p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Linux Storage & AWS EBS (With LVM)]]></title><description><![CDATA[Imagine you are sitting in front of a brand-new Linux machine.
No C drive.No D drive.No familiar structure.
Instead, you see raw storage devices such as:
/dev/xvda # older system
/dev/nvme0n1 # modern]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/understanding-linux-storage-aws-ebs-with-lvm</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/understanding-linux-storage-aws-ebs-with-lvm</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Fri, 17 Apr 2026 13:51:03 GMT</pubDate><content:encoded><![CDATA[<p>Imagine you are sitting in front of a brand-new Linux machine.</p>
<p>No C drive.<br />No D drive.<br />No familiar structure.</p>
<p>Instead, you see raw storage devices such as:</p>
<pre><code class="language-plaintext">/dev/xvda # older system
/dev/nvme0n1 # modern system
</code></pre>
<p>This raises two important questions:</p>
<ul>
<li><p>How does Linux organize storage internally?</p>
</li>
<li><p>How do cloud platforms like AWS provide and manage storage?</p>
</li>
</ul>
<hr />
<h3>PART 1: START FROM ZERO</h3>
<p>Before commands… before AWS… before LVM…</p>
<p>Think of storage like empty land.</p>
<p>You cannot live on empty land directly.</p>
<p>You must:</p>
<ol>
<li><p>Prepare the land</p>
</li>
<li><p>Combine land if needed</p>
</li>
<li><p>Build rooms</p>
</li>
<li><p>Put furniture</p>
</li>
<li><p>Start using it</p>
</li>
</ol>
<p>👉 Linux storage works <strong>exactly like this</strong>.</p>
<h2>Real World vs Computer World</h2>
<table>
<thead>
<tr>
<th>Real World</th>
<th>Computer World</th>
</tr>
</thead>
<tbody><tr>
<td>Land</td>
<td>Disk</td>
</tr>
<tr>
<td>Rooms</td>
<td>Partitions / LVM volumes</td>
</tr>
<tr>
<td>Shelves</td>
<td>Filesystem</td>
</tr>
<tr>
<td>Door</td>
<td>Mount</td>
</tr>
</tbody></table>
<hr />
<h3>What is a Disk?</h3>
<p>A disk is just <strong>raw empty space</strong>.</p>
<p>Example:</p>
<pre><code class="language-plaintext">/dev/nvme0n1 = 30GB empty storage
</code></pre>
<p>At this stage:</p>
<ul>
<li><p>No structure</p>
</li>
<li><p>Not usable for files</p>
</li>
<li><p>Just raw storage</p>
</li>
</ul>
<p>👉 Disk = empty land</p>
<hr />
<h3>BLOCK LEVEL THINKING</h3>
<p>Everything in Linux storage is built using blocks.</p>
<p>So conceptually:</p>
<ul>
<li><p>Block = smallest unit (e.g., 4KB)</p>
</li>
<li><p>Disk = collection of blocks</p>
</li>
<li><p>Volume = logical grouping of storage</p>
</li>
</ul>
<blockquote>
<p>“Blocks build disks — disks don’t equal blocks.”</p>
</blockquote>
<p><strong>Analogy</strong></p>
<p>Think LEGO:</p>
<ul>
<li><p>Each brick = block</p>
</li>
<li><p>Many bricks = structure</p>
</li>
</ul>
<hr />
<h3>LINUX VIEW</h3>
<p>Linux doesn’t show drives like Windows.</p>
<p>You see raw block devices like:</p>
<pre><code class="language-plaintext">/dev/xvda
/dev/xvdf
</code></pre>
<p>These are physical or virtual disks exposed to the operating system.</p>
<hr />
<h3>\WHAT IS A VOLUME</h3>
<p>A volume is a logical storage unit created from blocks.</p>
<p>Think of your laptop:</p>
<p>🔸C Drive is one volume<br />🔸D Drive is another volume</p>
<p>Internally, these are just partitions carved out of a disk or LVM.</p>
<hr />
<h2>PART 2: WHAT AWS GIVES YOU</h2>
<h3>EBS:</h3>
<p>👉 It is just a <strong>virtual disk given by AWS</strong></p>
<p>Like:</p>
<blockquote>
<p>“Amazon gives you an external hard drive over the internet”</p>
</blockquote>
<p>So the mapping becomes:</p>
<blockquote>
<p>EC2 equals Computer<br />EBS equals External Storage Device</p>
</blockquote>
<p>Example:</p>
<pre><code class="language-plaintext">/dev/nvme1n1
</code></pre>
<p>👉 Still not usable yet</p>
<hr />
<h2>PART 3: AWS STORAGE ARCHITECTURE</h2>
<p>Now let’s connect this to real cloud infrastructure.</p>
<p>When AWS gives you a server, it does not just give CPU and RAM.</p>
<p>It also gives storage.</p>
<h3>AWS COMPONENTS</h3>
<p>EC2 is your virtual computer.</p>
<p>EBS is your persistent storage system.</p>
<p>Key property:</p>
<p>Even if EC2 stops, EBS data still remains safe.</p>
<hr />
<h3>ROOT VOLUME</h3>
<p>When you launch EC2:</p>
<ul>
<li><p>Default storage is <code>8 GB</code></p>
</li>
<li><p>Typically 8–30 GB depending on AMI.</p>
</li>
</ul>
<p>This is called root volume</p>
<p>It is mounted at:</p>
<pre><code class="language-plaintext">/
</code></pre>
<p>Device name:</p>
<pre><code class="language-plaintext">/dev/xvda
</code></pre>
<p>This contains the operating system itself.</p>
<hr />
<h2>PART 4: ATTACH VS MOUNT</h2>
<p>This is where most get confused.</p>
<p>So let’s simplify it completely.</p>
<h3>ATTACH</h3>
<p>Attach means hardware connection.</p>
<p>In AWS terms:</p>
<p><code>You connect EBS to EC2.</code></p>
<p>But Linux cannot use it yet.</p>
<h3>MOUNT</h3>
<p>Mount means making storage usable inside Linux.</p>
<p>You assign a folder path like:</p>
<pre><code class="language-plaintext">/mnt/data
</code></pre>
<p><strong>ANALOGY</strong></p>
<ul>
<li><p>Attach = plugging a USB drive into laptop</p>
</li>
<li><p>Mount = opening it inside file explorer</p>
</li>
</ul>
<h3>DIFFERENCE TABLE</h3>
<ul>
<li><p>Attach means device is physically connected</p>
</li>
<li><p>Mount means OS can read and write data</p>
</li>
</ul>
<hr />
<h2>PART 5: EC2 SETUP CONTEXT</h2>
<p>We create:</p>
<ul>
<li><p>Instance name: TWS Volume Instance</p>
</li>
<li><p>OS: Ubuntu</p>
</li>
<li><p>Instance type: t2.micro</p>
</li>
</ul>
<p>t2.micro is burstable, meaning CPU performance is credit based.</p>
<p>Storage works normally regardless.</p>
<hr />
<h2>PART 6: SSH SECURITY</h2>
<p>Before connecting:</p>
<blockquote>
<p>chmod 400 key.pem</p>
</blockquote>
<p>This ensures only you can access the key file securely.</p>
<hr />
<h2>PART 7: STORAGE VISIBILITY COMMANDS</h2>
<p><strong>lsblk</strong></p>
<ul>
<li>Shows block devices.</li>
</ul>
<p>It answers:</p>
<p>What disks exist in the system</p>
<hr />
<p><strong>df -h</strong></p>
<ul>
<li>Shows disk usage.</li>
</ul>
<p>It answers:</p>
<p>How much space is used in each room</p>
<hr />
<p><strong>DIFFERENCE</strong></p>
<p>🔸 lsblk is hardware view<br />🔸 df -h is filesystem view</p>
<hr />
<h2>PART 8: CREATING EBS VOLUMES</h2>
<p>We create multiple volumes:</p>
<ul>
<li><p>10 GB</p>
</li>
<li><p>12 GB</p>
</li>
<li><p>14 GB</p>
</li>
</ul>
<p>Think of them as external USB drives.</p>
<p><strong>Important rule:</strong></p>
<p>They must be in same <strong>availability zone</strong> as <strong>EC2</strong>.</p>
<hr />
<h3><strong>DEVICE MAPPING</strong></h3>
<p>AWS assigns:</p>
<pre><code class="language-plaintext">/dev/sdf becomes /dev/xvdf
/dev/sdg becomes /dev/xvdg
/dev/sdh becomes /dev/xvdh
</code></pre>
<p>Linux renames devices automatically based on detection order.</p>
<p>Modern AWS uses:</p>
<pre><code class="language-plaintext">/dev/nvme...
</code></pre>
<blockquote>
<p>“On newer instances, EBS appears as NVMe devices.”</p>
</blockquote>
<hr />
<h2>PART 9: ATTACHING VOLUMES</h2>
<p>After attaching:</p>
<pre><code class="language-plaintext">lsblk
</code></pre>
<p>You will see new disks without mount points.</p>
<p>Linux can see disks but cannot use them yet.</p>
<hr />
<h2>PART 10: INTRODUCTION TO LVM</h2>
<p>Now we move to the most powerful concept in Linux storage.</p>
<p><strong>LVM</strong>.</p>
<p>This is where storage becomes flexible instead of fixed.</p>
<p>LVM is like a <strong>smart storage manager inside Linux</strong></p>
<p>It helps you:</p>
<ul>
<li><p>Combine disks</p>
</li>
<li><p>Resize storage anytime</p>
</li>
<li><p>Avoid downtime</p>
</li>
<li><p>Manage space like building rooms in a house</p>
</li>
</ul>
<hr />
<h2>LVM STRUCTURE</h2>
<p>LVM has 3 levels</p>
<p>1️⃣ Physical Volume (PV)</p>
<p>2️⃣ Volume Group (VG)</p>
<p>3️⃣ Logical Volume (LV)</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/fcb8549d-79bc-47ca-b32a-56b6fadbebd0.png" alt="" style="display:block;margin:0 auto" />

<p><strong>ANALOGY</strong></p>
<ul>
<li><p>Physical Volume equals raw bricks</p>
</li>
<li><p>Volume Group equals stack of bricks</p>
</li>
<li><p>Logical Volume equals actual room built from bricks</p>
</li>
<li><p>LVM = architect + builder</p>
<p>LVM decides:</p>
<blockquote>
<p>“This part is kitchen, this is bedroom, this is store room”</p>
</blockquote>
</li>
</ul>
<hr />
<h3>Quick Insight</h3>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/2c857c22-7bd0-42ef-a8cd-e8d9990b3e2d.png" alt="" style="display:block;margin:0 auto" />

<ul>
<li><p>If <strong>PV fails</strong> → VG &amp; LV automatically impacted</p>
</li>
<li><p>If <strong>VG fails</strong> → LV unavailable</p>
</li>
<li><p>If <strong>LV fails</strong> → filesystem/mount breaks next</p>
</li>
</ul>
<p>👉 Root cause usually starts <strong>from PV layer</strong></p>
<hr />
<h3>PART 11: WHY LVM EXISTS</h3>
<p>Without LVM:</p>
<ul>
<li><p>Fixed partitions</p>
</li>
<li><p>Hard to resize</p>
</li>
<li><p>Downtime required</p>
</li>
</ul>
<p>With LVM:</p>
<ul>
<li><p>Dynamic resizing</p>
</li>
<li><p>No downtime</p>
</li>
<li><p>Flexible storage</p>
</li>
</ul>
<hr />
<h2>PART 12: CREATING PHYSICAL VOLUME (PV)</h2>
<p>These are your actual storage devices:</p>
<ul>
<li><p><code>/dev/sda</code></p>
</li>
<li><p><code>/dev/sdb</code></p>
</li>
<li><p><code>/dev/sdc</code></p>
</li>
</ul>
<p>👉 Think: <strong>raw hard drives or partitions</strong></p>
<p>👉 “Prepare land”</p>
<pre><code class="language-plaintext">Disk → PV = usable land
</code></pre>
<p>Command:</p>
<pre><code class="language-plaintext">pvcreate /dev/nvme1n1
pvcreate /dev/xvdf /dev/xvdg
</code></pre>
<p>👉 Meaning:</p>
<blockquote>
<p>“Make this disk usable for building system”</p>
</blockquote>
<hr />
<h2>PART 13: CREATING VOLUME GROUP (VG)</h2>
<p><strong>Volume Group (VG)</strong> = pool of storage</p>
<p>👉 “Combine lands”</p>
<pre><code class="language-plaintext">PV1 + PV2 → VG (big land)
</code></pre>
<p>Command:</p>
<pre><code class="language-plaintext">vgcreate tws_vg /dev/xvdf /dev/xvdg
vgcreate devops-vg /dev/nvme1n1 /dev/nvme2n1
</code></pre>
<p>You take multiple PVs and combine them into one big pool.</p>
<p>Meaning:</p>
<blockquote>
<p>“Merge all land into one big property”</p>
</blockquote>
<p>👉 Think:</p>
<blockquote>
<p>“I don’t care which disk space comes from — just give me total space”</p>
</blockquote>
<p>Example:</p>
<ul>
<li><p>3 disks of 500GB → VG = 1500GB pool</p>
</li>
<li><p>10 GB plus 12 GB becomes 22 GB pool</p>
</li>
</ul>
<hr />
<h2>PART 14: CREATING LOGICAL VOLUME (LV)</h2>
<p><strong>Logical Volume (LV)</strong> = usable partitions</p>
<p>👉 “Build rooms”</p>
<pre><code class="language-plaintext">VG → LV (rooms inside land)
</code></pre>
<p>Command:</p>
<pre><code class="language-plaintext">lvcreate -L 10G -n tws_lv tws_vg
lvcreate -L 500M -n app-data devops-vg
</code></pre>
<p>This creates usable storage from pool.</p>
<p>Meaning:</p>
<blockquote>
<p>“Create one usable room of 500MB”</p>
</blockquote>
<hr />
<h2>Real-world analogy</h2>
<ul>
<li><p>PV = individual water tanks</p>
</li>
<li><p>VG = one big connected water system</p>
</li>
<li><p>LV = taps pulling water from that system</p>
</li>
</ul>
<p>You don’t care which tank the water came from.</p>
<hr />
<h2>PART 15: DISPLAY COMMANDS</h2>
<pre><code class="language-plaintext">pvs
vgs
lvs
pvdisplay
vgdisplay
lvdisplay
</code></pre>
<p>These show storage layers.</p>
<hr />
<h2>PART 16: FORMATTING STORAGE</h2>
<pre><code class="language-plaintext">mkfs.ext4 /dev/devops-vg/app-data
mkfs.xfs /dev/tws_vg/tws_lv
</code></pre>
<p>This prepares filesystem structure.</p>
<hr />
<h2>PART 17: MOUNTING STORAGE</h2>
<pre><code class="language-plaintext">mkdir -p /mnt/tws_lv_mount 
mount /dev/tws_vg/tws_lv /mnt/tws_lv_mount
</code></pre>
<p>Now storage is usable.</p>
<hr />
<h2>PART 18: TESTING STORAGE</h2>
<pre><code class="language-plaintext">cd /mnt/tws_lv_mount echo "hello" &gt; file.txt
</code></pre>
<p>If file is created, system is working correctly.</p>
<hr />
<h2>PART 19: UNMOUNTING</h2>
<pre><code class="language-plaintext">umount /mnt/tws_lv_mount
</code></pre>
<h3>Important concept:</h3>
<p>Data is NOT deleted Only access is removed</p>
<hr />
<h2>PART 20: DIRECT EBS USAGE (WITHOUT LVM)</h2>
<pre><code class="language-plaintext">mkfs.ext4 /dev/xvdh 
mkdir /mnt/disk_mount 
mount /dev/xvdh /mnt/disk_mount
</code></pre>
<p>This is simple disk usage without abstraction layer.</p>
<hr />
<h3>PART 21: STORAGE EXPANSION</h3>
<pre><code class="language-plaintext">lvextend -L +5G /dev/tws_vg/tws_lv
lvextend -L +5G /dev/devops-vg/app-data
</code></pre>
<p>Then:</p>
<pre><code class="language-plaintext">resize2fs /dev/devops-vg/app-data   # ext4
xfs_growfs /mnt/data               # XFS
</code></pre>
<p>This increases storage live.</p>
<hr />
<h2>MOST IMPORTANT CONFUSION FIX</h2>
<p><strong>Wrong idea:</strong></p>
<blockquote>
<p>“LVM is backed by EBS”</p>
</blockquote>
<p><strong>Correct idea:</strong></p>
<blockquote>
<p>“LVM can use EBS disks as input storage”</p>
</blockquote>
<p><strong>Behind the scenes:</strong></p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/f3ce46e2-4b8e-4fb5-8633-5ea3120c148d.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>WHY COMPANIES USE BOTH</h3>
<h3>Without LVM:</h3>
<ul>
<li><p>You must resize each disk manually</p>
</li>
<li><p>Hard to scale databases</p>
</li>
</ul>
<h3>With LVM:</h3>
<ul>
<li><p>No downtime</p>
</li>
<li><p>Flexible storage - Add new EBS disk anytime</p>
</li>
<li><p>Easy scaling - Extend storage live</p>
</li>
<li><p>Safe resizing</p>
</li>
</ul>
<h3>Used in:</h3>
<ul>
<li><p>Databases</p>
</li>
<li><p>Logs storage</p>
</li>
<li><p>Kubernetes nodes</p>
</li>
<li><p>Production servers</p>
</li>
</ul>
<hr />
<h3>CONCLUSION</h3>
<p>Storage in AWS and Linux is not complex when visualized correctly.</p>
<p>Everything becomes simple when you understand:</p>
<p>🔸 Blocks form disks</p>
<p>🔸 Disks form volumes</p>
<p>🔸 LVM organizes volumes</p>
<p>🔸 EBS provides cloud disks</p>
<hr />
<h3>FINAL ANALOGY</h3>
<p>Think:</p>
<p>You are building storage step by step like construction:</p>
<p>Bricks → Walls → Rooms → House</p>
<p>That is exactly how LVM works.</p>
<hr />
<h2>Learning Resources</h2>
<ul>
<li><strong>Hands-on Lab:</strong><br />👉 <a href="https://90-days-devops-with-shubham.hashnode.dev/linux-lvm-lab">Linux LVM Lab</a></li>
</ul>
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Happy Learning</p>
]]></content:encoded></item><item><title><![CDATA[Linux LVM Lab]]></title><description><![CDATA[Learning Resources

📖 Conceptual Understanding:👉 Understanding Linux Storage (AWS EBS + LVM)


Learn how to:

Add new disk (EBS in AWS)

Create Physical Volume (PV)

Create Volume Group (VG)

Create]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/linux-lvm-lab</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/linux-lvm-lab</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Fri, 17 Apr 2026 13:48:55 GMT</pubDate><content:encoded><![CDATA[<h2>Learning Resources</h2>
<ul>
<li><strong>📖 Conceptual Understanding:</strong><br />👉 <a href="https://90-days-devops-with-shubham.hashnode.dev/understanding-linux-storage-aws-ebs-with-lvm">Understanding Linux Storage (AWS EBS + LVM)</a></li>
</ul>
<hr />
<p>Learn how to:</p>
<ul>
<li><p>Add new disk (EBS in AWS)</p>
</li>
<li><p>Create Physical Volume (PV)</p>
</li>
<li><p>Create Volume Group (VG)</p>
</li>
<li><p>Create Logical Volume (LV)</p>
</li>
<li><p>Format + Mount storage</p>
</li>
<li><p>Extend storage without downtime</p>
</li>
</ul>
<h2>STEP BY STEP</h2>
<h3>STEP 0: Understand what you are doing</h3>
<p>You are basically building storage like this:</p>
<pre><code class="language-plaintext">Disk (EBS)
  ↓
PV (prepare disk)
  ↓
VG (combine disks)
  ↓
LV (create usable storage)
  ↓
Filesystem (format)
  ↓
Mount (use it like folder)
</code></pre>
<hr />
<h3>STEP 1: Add storage in AWS (IMPORTANT)</h3>
<p>Go to:</p>
<p>👉 AWS EC2 → Volumes → Create Volume</p>
<ul>
<li><p>Size: <strong>10 GB (or 8 GB)</strong></p>
</li>
<li><p>Same Availability Zone as EC2</p>
</li>
<li><p>Attach to your instance</p>
</li>
</ul>
<p>Now inside Linux, check:</p>
<pre><code class="language-plaintext">lsblk
</code></pre>
<p>Check disk availability.</p>
<p>You should see something like:</p>
<pre><code class="language-plaintext">/dev/nvme1n1   10G
</code></pre>
<p>👉 This is your NEW disk</p>
<hr />
<p>STEP 2: Become root user</p>
<pre><code class="language-plaintext">sudo -i
</code></pre>
<p>Become root user.</p>
<hr />
<p>STEP 3: Check current storage</p>
<pre><code class="language-plaintext">lsblk
pvs
vgs
lvs
df -h
</code></pre>
<p>Check current storage state.</p>
<p>What this means:</p>
<ul>
<li><p><code>lsblk</code> → show disks</p>
</li>
<li><p><code>pvs</code> → show physical volumes</p>
</li>
<li><p><code>vgs</code> → show volume groups</p>
</li>
<li><p><code>lvs</code> → show logical volumes</p>
</li>
</ul>
<p>At this stage:<br />👉 You should NOT see LVM yet (fresh start disk)</p>
<hr />
<p>STEP 4: Create Physical Volume (PV)</p>
<p>“Prepare disk for LVM”</p>
<pre><code class="language-plaintext">pvcreate /dev/nvme1n1
</code></pre>
<p>Create physical volume.</p>
<p>Verify:</p>
<pre><code class="language-plaintext">pvs
</code></pre>
<p>👉 Now disk is ready for LVM</p>
<hr />
<h3>STEP 5: Create Volume Group (VG)</h3>
<p>👉 “Combine storage into one pool”</p>
<pre><code class="language-plaintext">vgcreate devops-vg /dev/nvme1n1
</code></pre>
<p>Create volume group.</p>
<p>Verify:</p>
<pre><code class="language-plaintext">vgs
</code></pre>
<p>👉 Now you have a storage pool</p>
<hr />
<h3>STEP 6: Create Logical Volume (LV)</h3>
<p>👉 “Create actual usable storage”</p>
<pre><code class="language-plaintext">lvcreate -L 500M -n app-data devops-vg
</code></pre>
<p>Create logical volume.</p>
<p>Verify:</p>
<pre><code class="language-plaintext">lvs
</code></pre>
<p>👉 You now have a 500MB storage block</p>
<hr />
<h3>STEP 7: Format the storage - Filesystem (VERY IMPORTANT)</h3>
<p>👉 “Make it usable like a folder system”</p>
<p>Now room is empty → we need shelves</p>
<pre><code class="language-plaintext">mkfs.ext4 /dev/devops-vg/app-data
</code></pre>
<p>Format storage.</p>
<p>Meaning:</p>
<blockquote>
<p>“Install storage system inside room”</p>
</blockquote>
<hr />
<h3>STEP 8: Create mount folder</h3>
<p>👉 “Create place where storage will be attached”</p>
<pre><code class="language-plaintext">mkdir -p /mnt/app-data
</code></pre>
<p>Create mount directory.</p>
<hr />
<h3>STEP 9: Mount the storage</h3>
<p>👉 “Attach LV to folder”</p>
<p>Now we attach room to a door:</p>
<pre><code class="language-plaintext">mount /dev/devops-vg/app-data /mnt/app-data
</code></pre>
<p>Meaning:</p>
<blockquote>
<p>“Now I can enter this room from /mnt/app-data”</p>
</blockquote>
<p>Check:</p>
<pre><code class="language-plaintext">df -h /mnt/app-data
</code></pre>
<p>👉 Now storage is usable like a normal folder</p>
<hr />
<h3>STEP 10: Test storage</h3>
<pre><code class="language-plaintext">cd /mnt/app-data 
touch file1.txt
ls
</code></pre>
<p>Test storage- If file is created → SUCCESS</p>
<hr />
<h3>STEP 11: Extend storage</h3>
<p>👉 Increase storage without stopping system</p>
<p>Increase storage without stopping system</p>
<pre><code class="language-plaintext">lvextend -L +200M /dev/devops-vg/app-data
</code></pre>
<p>Now resize filesystem:</p>
<pre><code class="language-plaintext">resize2fs /dev/devops-vg/app-data
</code></pre>
<p>Verify:</p>
<pre><code class="language-plaintext">df -h /mnt/app-data
</code></pre>
<p>👉 Storage increased LIVE (no downtime)</p>
<p>Meaning:</p>
<ol>
<li><p>Increase room size</p>
</li>
<li><p>Tell shelves to use new space</p>
</li>
</ol>
<hr />
<h2>What you built:</h2>
<p>Ever wondered how storage flows in Linux?</p>
<p>From cloud disk to usable data:</p>
<pre><code class="language-plaintext">EBS → PV → VG → LV → Filesystem → Mount
</code></pre>
<p>Understanding this stack makes troubleshooting 10x easier.</p>
<h3>SIMPLE ANALOGY</h3>
<p>Think:</p>
<p>🔸PV = bricks</p>
<p>🔸VG = construction site</p>
<p>🔸LV = room</p>
<p>🔸filesystem = furniture</p>
<p>You just:</p>
<ul>
<li><p>added new bricks</p>
</li>
<li><p>expanded building</p>
</li>
<li><p>made bigger room</p>
</li>
<li><p>without breaking house</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/bdc5d74a-961f-470c-9488-cdc26ffa1d90.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>LVM teardown (how to delete safely)</h2>
<h3>Rule</h3>
<p>👉 You always delete in <strong>reverse order</strong></p>
<pre><code class="language-plaintext">LV → VG → PV → Disk
</code></pre>
<p>Because:</p>
<ul>
<li><p>LV depends on VG</p>
</li>
<li><p>VG depends on PV</p>
</li>
<li><p>PV depends on disk</p>
</li>
</ul>
<hr />
<h3>STEP 0: Check what exists</h3>
<pre><code class="language-plaintext">lsblk
lvs
vgs
pvs
df -h
</code></pre>
<hr />
<h3>STEP 1: Unmount filesystem</h3>
<p>👉 You cannot delete anything while it is mounted</p>
<pre><code class="language-plaintext">umount /mnt/app-data
</code></pre>
<p>Check:</p>
<pre><code class="language-plaintext">df -h
</code></pre>
<hr />
<h3>STEP 2: Remove Logical Volume (LV)</h3>
<p>👉 Delete actual storage block</p>
<pre><code class="language-plaintext">lvremove /dev/devops-vg/app-data
</code></pre>
<p>Confirm with <code>y</code></p>
<p>Check:</p>
<pre><code class="language-plaintext">lvs
</code></pre>
<hr />
<h3>STEP 3: Remove Volume Group (VG)</h3>
<p>👉 Delete storage pool</p>
<pre><code class="language-plaintext">vgremove devops-vg
</code></pre>
<p>Check:</p>
<pre><code class="language-plaintext">vgs
</code></pre>
<hr />
<h3>STEP 4: Remove Physical Volume (PV)</h3>
<p>👉 Remove LVM metadata from disk</p>
<pre><code class="language-plaintext">pvremove /dev/nvme1n1
</code></pre>
<p>Check:</p>
<pre><code class="language-plaintext">pvs
</code></pre>
<hr />
<h3>FINAL RESULT</h3>
<p>Now disk is clean:</p>
<pre><code class="language-plaintext">/dev/nvme1n1 → normal empty disk again
</code></pre>
<hr />
<h3>SIMPLE TRICK</h3>
<p>👉 Delete like peeling an onion:</p>
<pre><code class="language-plaintext">LV → VG → PV → Disk
</code></pre>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Happy Learning</p>
]]></content:encoded></item><item><title><![CDATA[Revision (Days 01–11)]]></title><description><![CDATA[Refer for In detail: https://90-days-devops-with-shubham.hashnode.dev/day-1-11-devops-commands
BASIC NAVIGATION
pwd → current directory
ls → list files
ls -l → detailed file listing
ls -a → show hidde]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/revision-days-01-11</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/revision-days-01-11</guid><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Thu, 16 Apr 2026 15:49:54 GMT</pubDate><content:encoded><![CDATA[<p>Refer for In detail: <a href="https://90-days-devops-with-shubham.hashnode.dev/day-1-11-devops-commands">https://90-days-devops-with-shubham.hashnode.dev/day-1-11-devops-commands</a></p>
<h2>BASIC NAVIGATION</h2>
<pre><code class="language-plaintext">pwd → current directory
ls → list files
ls -l → detailed file listing
ls -a → show hidden files
cd → change directory
cd .. → go back one directory
cd ~ → go to home directory
whoami → current user
date → show date and time
cal → show calendar
clear → clear terminal screen
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b9364a45-fdee-437f-a60f-79fb634172f4.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/28e7c2c8-1bf1-47b5-8723-1f4fcf1dd4b3.png" alt="" style="display:block;margin:0 auto" />

<p>You ran:</p>
<pre><code class="language-plaintext">cd day12/devops_lab/file.txt
</code></pre>
<p>👉 Problem:</p>
<ul>
<li><p><code>cd</code> is used for <strong>directories only</strong></p>
</li>
<li><p><code>file.txt</code> is a <strong>file</strong>, not a folder</p>
</li>
</ul>
<p>So Linux correctly said:</p>
<pre><code class="language-plaintext">No such file or directory
</code></pre>
<h3>RULE</h3>
<p>✔ <code>cd</code> → only for directories<br />✔ <code>cat</code> / <code>less</code> → for files</p>
<p>Why cd file.txt fails?”</p>
<p>Answer:</p>
<blockquote>
<p>Because cd works only with directories, not files.</p>
</blockquote>
<h3>Solution:</h3>
<p>Run:</p>
<pre><code class="language-plaintext">cd day12/devops_lab
ls
cat file.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/364aacd4-03d6-4840-8f26-458b9ad9df84.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/775bbdd4-2e2f-4a3b-a004-655ed6ae68fa.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>FILE &amp; Directory MANAGEMENT</h2>
<pre><code class="language-plaintext">mkdir dir1 → create folder
mkdir -p dir1/dir2 → create nested folders
rmdir dir1 → delete empty folder
rm -r dir1 → delete folder with contents
touch → create empty file
cp file.txt file2.txt → copy file
cp -r dir1 dir2 → copy directory
mv file.txt newfile.txt → move or rename file
mv file.txt /path/ → move file to path
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/2d115796-86bf-4b55-a87a-17d14185f34f.png" alt="" style="display:block;margin:0 auto" />

<p>ISSUE 1</p>
<pre><code class="language-plaintext">mkdir day12/dir1/dir2
</code></pre>
<p>Error:</p>
<pre><code class="language-plaintext">No such file or directory
</code></pre>
<p>👉 Why?</p>
<ul>
<li><p><code>day12/dir1</code> does NOT exist yet</p>
</li>
<li><p><code>mkdir</code> cannot create nested folders by default</p>
</li>
</ul>
<p>Fix:</p>
<pre><code class="language-plaintext">mkdir -p day12/dir1/dir2 # all folders created successfully
</code></pre>
<p>👉 It creates:</p>
<pre><code class="language-plaintext">day12/
day12/dir1/
day12/dir1/dir2/
</code></pre>
<hr />
<p>ISSUE 2 (PATH CONFUSION)</p>
<p>You were here:</p>
<pre><code class="language-plaintext">/home/ubuntu/day12/dir
</code></pre>
<p>Then used:</p>
<pre><code class="language-plaintext">cd ~/dir/dir1/dir2
</code></pre>
<p>👉 <code>~</code> ALWAYS means:</p>
<pre><code class="language-plaintext">/home/ubuntu
</code></pre>
<p>So it ignored current path.</p>
<hr />
<h3>RULES</h3>
<p>✔ <code>~</code> = Always means home directory<br />✔ Relative path = from current location<br />✔ Absolute path = from <code>/home/...</code><br />✔ Use <code>pwd</code> when confused</p>
<hr />
<h3>PRACTICE</h3>
<p>Run these EXACTLY:</p>
<pre><code class="language-plaintext">cd ~
cd day12
cd dir/dir1/dir2
pwd
</code></pre>
<p>Now try absolute path:</p>
<pre><code class="language-plaintext">cd ~
cd day12/dir/dir1/dir2
</code></pre>
<p>From anywhere, run:</p>
<pre><code class="language-plaintext">cd ~/dir/dir1/dir2 # issue
cd ~/day12/dir/dir1/dir2
pwd
</code></pre>
<p>👉 If it works → you understood paths perfectly</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b5707e5e-3b9f-477d-ad0b-50b60f8504af.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b5fb1d06-882e-4ca4-928f-d621b2e20885.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/a25d905c-2d04-4ca5-b56d-1f35f1660336.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/07a5207f-cfea-444c-b656-4b7cf07057d7.png" alt="" style="display:block;margin:0 auto" />

<p>SUMMARY<br />✔ mv file → file = rename<br />✔ mv file → folder = move<br />✔ mv folder → folder = move<br />✔ mv folder → new name = rename</p>
<hr />
<h2>Viewing File Content</h2>
<pre><code class="language-plaintext">cat file.txt → full file content
less file.txt → scroll file content
more file.txt → page-by-page view
head file.txt → first lines of file
head -n 5 file.txt → first 5 lines
tail file.txt → last lines of file
tail -n 10 file.txt → last 10 lines
tail -f file.txt → live log monitoring
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/c89204cc-7279-496d-85a3-ef8757150f03.png" alt="" style="display:block;margin:0 auto" />

<h2>tail -f file.txt → live log monitoring</h2>
<h3>Step 1 (run this):</h3>
<pre><code class="language-plaintext">tail -f day12-test.log
</code></pre>
<p>👉 It will wait (no output initially)</p>
<h3>Step 2 (open NEW terminal OR background)</h3>
<p>Run:</p>
<pre><code class="language-plaintext">echo "New log entry" &gt;&gt; day12-test.log
</code></pre>
<p>👉 You will see instantly in first terminal:</p>
<pre><code class="language-plaintext">New log entry
</code></pre>
<p>When app crashes:</p>
<pre><code class="language-plaintext">tail -f /var/log/syslog
</code></pre>
<p>👉 Watch logs live<br />👉 Debug production issues</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/9c2c3684-e418-45c7-a8da-d5c768242daa.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>PERMISSIONS</h2>
<pre><code class="language-plaintext">ls -l → view permissions
chmod → change permissions
chmod 777 file.txt → full access to everyone
chmod 755 file.sh → owner full, others read/execute
chmod +x script.sh → make executable
chmod -w file.txt → remove write permission
chown → change owner
chown user file.txt → change owner
chown user:group file.txt → change owner and group
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/d4fb01db-1f6a-4456-8e81-acdf60202013.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/29747991-306d-4730-a9b5-93c284b4eb88.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>USERS &amp; Group Management</h2>
<pre><code class="language-plaintext">adduser → create user
sudo adduser username → create user with home
sudo useradd username → create user (no home default)
usermod → modify user
passwd → set password
sudo passwd username → set user password
groups → show group info
groups username → show user groups
id username → show UID/GID info
sudo deluser username → delete user
sudo groupadd groupname → create group
sudo usermod -aG groupname username → add user to group
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/de64488d-e32a-4692-9db1-b0a8431a6617.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/dffa4702-e164-49c0-a30b-237fb3f1aaea.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/da13b2ac-a61c-4b02-bffb-bd3e7ffe41fa.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>SYSTEM INFO (Package Management (Ubuntu/Debian))</h2>
<pre><code class="language-plaintext">uname -a → system information
uptime → system running time
whoami → current user
sudo apt update → update package list
sudo apt upgrade → upgrade packages
sudo apt install nginx → install package
sudo apt remove nginx → remove package
sudo apt purge nginx → remove package with config
sudo apt autoremove → remove unused dependencies
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/d2eba84f-92db-4839-9685-e277cb82e0bf.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>DISK &amp; MEMORY</h2>
<pre><code class="language-plaintext">df -h → disk usage
df -Th → disk usage with filesystem type
du -sh → folder size
du -h → file/folder size breakdown
free -m → memory usage in MB
lsblk → list block devices
mount → mount filesystem
umount /dev/sdX → unmount filesystem
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/42a78b87-f753-4472-8833-f2b826c46622.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/34eb10af-0dc8-47d1-ae3f-957985554ceb.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>NETWORKING</h2>
<pre><code class="language-plaintext">ip a → show IP address
ifconfig → network configuration (legacy)
ping google.com → test connectivity
curl https://google.com → API/web request
wget https://example.com/file.zip → download file
netstat -tuln → show open ports
ss -tuln → modern port checker
hostname → show system name
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b3305219-c4bb-40cd-a2b9-4128a357c8e2.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>PROCESS MANAGEMENT</h2>
<pre><code class="language-plaintext">ps -ef → all processes
ps → current shell processes
ps aux → detailed processes
top → real-time monitoring
htop → advanced monitoring
kill PID → stop process
kill -9 PID → force stop process
pkill process_name → kill by name
jobs → show background jobs
bg → send job to background
fg → bring job to foreground
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/efb9cd6f-b4ca-4dda-a71f-c7f8a0e3206b.png" alt="" style="display:block;margin:0 auto" />

<h3>STEP 1: Run long job</h3>
<pre><code class="language-plaintext">sleep 100
</code></pre>
<p>👉 Terminal is stuck (running)</p>
<hr />
<h3>STEP 2: Pause it</h3>
<p>Press:</p>
<pre><code class="language-plaintext">Ctrl + Z
</code></pre>
<p>👉 Output:</p>
<pre><code class="language-plaintext">Stopped
</code></pre>
<hr />
<h3>STEP 3: Check jobs</h3>
<pre><code class="language-plaintext">jobs
</code></pre>
<p>👉 Output:</p>
<pre><code class="language-plaintext">[1]+ Stopped sleep 100
</code></pre>
<hr />
<h3>STEP 4: Send to background</h3>
<pre><code class="language-plaintext">bg
</code></pre>
<p>👉 Output:</p>
<pre><code class="language-plaintext">[1]+ Running sleep 100 &amp;
</code></pre>
<hr />
<h3>STEP 5: Bring back</h3>
<pre><code class="language-plaintext">fg
</code></pre>
<p>👉 Output:</p>
<pre><code class="language-plaintext">sleep 100
</code></pre>
<hr />
<h2>SEARCHING &amp; Text Processing</h2>
<pre><code class="language-plaintext">grep "text" file.txt → search text in file
grep -i "text" file.txt → case-insensitive search
find . -name file.txt → find file
find / -type f -name "*.log" → find log files
wc file.txt → count lines/words/bytes
wc -l file.txt → count lines only
sort file.txt → sort content
uniq file.txt → remove duplicates
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/da68aba7-5b2e-4e24-b0ba-a8784a042344.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>ARCHIVING &amp; Compression</h2>
<pre><code class="language-plaintext">tar -cvf archive.tar folder/ → create archive
tar -xvf archive.tar → extract archive
tar -czvf archive.tar.gz folder/ → create compressed archive
tar -xzvf archive.tar.gz → extract compressed archive
zip file.zip file.txt → compress zip
unzip file.zip → extract zip
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/5b919a9a-8d3a-4275-b63e-1655de0d1d03.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/3f470fee-13fc-4c05-b726-52143ee66f8f.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>BONUS TOOLS</h2>
<pre><code class="language-plaintext">history → previous commands
alias → shortcut command
echo "text" → print text
env → environment variables
export VAR=value → set environment variable
which command → command location
whereis command → binary location
man command → command manual page
uname -a → system info
uptime → system uptime
df -Th → filesystem info
ps -ef → process snapshot
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/198c8a54-7d86-46f6-b82e-acfcdf074993.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/d46249cb-ade5-487c-8f1a-49a81fe65a15.png" alt="" style="display:block;margin:0 auto" />

<p><img src="align=%22center%22" alt="" /></p>
]]></content:encoded></item><item><title><![CDATA[Day 1–11 DevOps Commands]]></title><description><![CDATA[Day 1 (Linux Basics)

🔹 pwd
🔸 What it doesShows current working directory.
🔸 Syntax
pwd

🔸 Example
pwd

🔸 Output
/home/ubuntu

🔸 Real-world use
Used before running scripts to confirm current loc]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-1-11-devops-commands</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-1-11-devops-commands</guid><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Thu, 16 Apr 2026 15:47:57 GMT</pubDate><content:encoded><![CDATA[<h2>Day 1 (Linux Basics)</h2>
<hr />
<h2>🔹 <code>pwd</code></h2>
<p>🔸 What it does<br />Shows current working directory.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">pwd
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">pwd
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">/home/ubuntu
</code></pre>
<p>🔸 Real-world use</p>
<p>Used before running scripts to confirm current location.</p>
<hr />
<h3>🔹 <code>ls</code></h3>
<p>🔸 What it does</p>
<p>Lists files and directories.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ls
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ls
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">file1.txt folder1 script.sh
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check files before editing, deleting, or running.</p>
<hr />
<h3>🔹 <code>ls -l</code></h3>
<p>🔸 What it does</p>
<p>Shows detailed file info (permissions, owner, size, time).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ls -l
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ls -l
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">-rw-r--r-- 1 user user 120 Apr 10 file1.txt
drwxr-xr-x 2 user user 4096 Apr 10 folder1
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check permissions before executing scripts or debugging access issues.</p>
<hr />
<h3>🔹 <code>ls -a</code></h3>
<p>🔸 What it does</p>
<p>Shows hidden files (starting with <code>.</code>)</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ls -a
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ls -a
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">.  ..  .bashrc  file1.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to inspect config files like <code>.git</code>, <code>.env</code>, <code>.bashrc</code>.</p>
<hr />
<h3>🔹 <code>cd</code></h3>
<p>🔸 What it does</p>
<p>Changes directory.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">cd &lt;directory&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">cd Documents
</code></pre>
<p>🔸 Output</p>
<p>(no output, directory changes)</p>
<p>🔸 Real-world use</p>
<p>Used to move between project folders.</p>
<hr />
<h3>🔹 <code>cd ..</code></h3>
<p>🔸 What it does</p>
<p>Moves one directory up.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">cd ..
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">cd ..
</code></pre>
<p>🔸 Output</p>
<p>(no output)</p>
<p>🔸 Real-world use</p>
<p>Used to go back in directory structure.</p>
<hr />
<h3>🔹 <code>cd ~</code></h3>
<p>🔸 What it does</p>
<p>Moves to home directory.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">cd ~
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">cd ~
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">/home/username
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to quickly return to home directory.<br /><code>~</code> = Always means home directory</p>
<hr />
<h3>🔹 <code>cd -</code> → switch to previous directory</h3>
<p>🔸 What it does</p>
<p>Takes you back to the <strong>last directory you were in</strong></p>
<hr />
<h3>Example</h3>
<h3>Step 1:</h3>
<pre><code class="language-plaintext">cd /var
pwd
</code></pre>
<p>🔸 Output:</p>
<pre><code class="language-plaintext">/var
</code></pre>
<hr />
<h3>Step 2:</h3>
<pre><code class="language-plaintext">cd /etc
pwd
</code></pre>
<p>🔸 Output:</p>
<pre><code class="language-plaintext">/etc
</code></pre>
<hr />
<h3>Step 3:</h3>
<pre><code class="language-plaintext">cd -
</code></pre>
<p>🔸 Output:</p>
<pre><code class="language-plaintext">/var
</code></pre>
<hr />
<h3>Step 4:</h3>
<pre><code class="language-plaintext">cd -
</code></pre>
<p>🔸 Output:</p>
<pre><code class="language-plaintext">/etc
</code></pre>
<p><code>cd -</code> = <strong>toggle between two directories</strong></p>
<p>Real DevOps Usage</p>
<p>You often switch between:</p>
<ul>
<li><p>logs → <code>/var/log</code></p>
</li>
<li><p>config → <code>/etc/nginx</code></p>
</li>
<li><p>app → <code>/var/www</code></p>
</li>
</ul>
<p>Instead of typing full paths again:</p>
<pre><code class="language-plaintext">cd /var/log
cd /etc/nginx
cd -
</code></pre>
<p>🔸 Instantly goes back</p>
<p>Important Behavior</p>
<ul>
<li><p>Works only if you have visited another directory before</p>
</li>
<li><p>First time may not work if no previous path exists</p>
</li>
</ul>
<hr />
<h3>Difference (small but important)</h3>
<ul>
<li><p><code>cd</code> → default behavior (no argument)</p>
</li>
<li><p><code>cd ~</code> → explicitly saying “go to home”</p>
</li>
</ul>
<p>🔸 In practice: <strong>both are same</strong></p>
<p><code>cd -</code> → go back to previous directory</p>
<hr />
<h3>🔹 <code>whoami</code></h3>
<p>🔸 What it does</p>
<p>Shows current logged-in user.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">whoami
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">whoami
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">ubuntu
</code></pre>
<p>🔸 Real-world use</p>
<p>Used before sudo/admin actions.</p>
<hr />
<h3>🔹 <code>date</code></h3>
<p>🔸 What it does</p>
<p>Shows system date and time.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">date
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">date
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Thu Apr 16 10:30:25 IST 2026
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for logs and debugging time-based issues.</p>
<hr />
<h3>🔹 <code>cal</code></h3>
<p>🔸 What it does</p>
<p>Shows calendar.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">cal
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">cal
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">   April 2026
Su Mo Tu We Th Fr Sa
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for date tracking in scheduling tasks.</p>
<hr />
<h3>🔹 <code>clear</code></h3>
<p>🔸 What it does</p>
<p>Clears terminal screen.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">clear
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">clear
</code></pre>
<p>🔸 Output</p>
<p>(screen cleared)</p>
<p>🔸 Real-world use</p>
<p>Used to clean terminal for readability.</p>
<hr />
<h2>Day 2 – File &amp; Directory Management</h2>
<hr />
<h2>🔹 <code>mkdir</code></h2>
<p>🔸 What it does</p>
<p>Creates a new directory.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">mkdir &lt;directory_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">mkdir project
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># directory "project" created
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to create project folders for code, logs, or deployments.</p>
<hr />
<h2>🔹 <code>mkdir -p</code></h2>
<p>🔸 What it does</p>
<p>Creates nested directories (parent folders automatically created).</p>
<ul>
<li><code>-p</code> means → <strong>“parents” (create parent directories (full directory path) if needed</strong> even if intermediate folders don’t exist. <strong>)</strong></li>
</ul>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">mkdir -p dir1/dir2/dir3
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">mkdir -p devops/app/logs
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># full directory path created
devops/
devops/app/
devops/app/logs/
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in project setups and CI/CD folder structures.</p>
<hr />
<h2>🔹 <code>rmdir</code></h2>
<p>🔸 What it does</p>
<p>Removes empty directories.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">rmdir &lt;directory_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">rmdir test
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># directory removed (if empty)
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for cleanup of empty folders.</p>
<hr />
<h2>🔹 <code>rm -r</code></h2>
<p>🔸 What it does</p>
<p>Deletes directories with all contents.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">rm -r &lt;directory_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">rm -r project
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># folder and all files deleted
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in cleanup scripts and deployments (dangerous if misused).</p>
<h3>Difference:</h3>
<p>rmdir &lt;directory_name&gt; → delete folder with No content</p>
<p>rm -r &lt;directory_name&gt; → delete folder with content</p>
<h3>VERY IMPORTANT WARNING</h3>
<pre><code class="language-plaintext">rm -r *
</code></pre>
<p>🔸 Deletes EVERYTHING in folder (dangerous)</p>
<hr />
<h2>🔹 <code>touch</code></h2>
<p>🔸 What it does</p>
<p>Creates an empty file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">touch &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">touch app.py
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># empty file created
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to create config, script, or log files.</p>
<hr />
<h2>🔹 <code>cp</code></h2>
<p>🔸 What it does</p>
<p>Copies files.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">cp &lt;source&gt; &lt;destination&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">cp file.txt file2.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># file copied
</code></pre>
<p>🔸 Real understanding:</p>
<ul>
<li>file2.txt = exact copy of file.txt</li>
</ul>
<p>🔸 Real-world use</p>
<p>Used for backups and duplication of configs.</p>
<hr />
<h2>🔹 <code>cp -r</code></h2>
<p>🔸 What it does</p>
<p>Copies directories recursively.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">cp -r &lt;source_dir&gt; &lt;destination_dir&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">cp -r project backup_project
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">project backup_project renamed.txt

# directory copied
ls backup_project
file2.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for full project backup.</p>
<hr />
<h2>🔹 <code>mv</code></h2>
<p>🔸 What it does</p>
<p>Moves or renames files/directories.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">mv &lt;source&gt; &lt;destination&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">mv file.txt newfile.txt → rename
mv file.txt /home/user/ → move file
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># file renamed or moved
</code></pre>
<h3>mv file.txt newfile.txt → rename</h3>
<p>Run:</p>
<pre><code class="language-plaintext">mv file1.txt renamed.txt
ls
</code></pre>
<p>🔸 Output:</p>
<pre><code class="language-plaintext">renamed.txt  file2.txt
</code></pre>
<p>🔸 Important:</p>
<ul>
<li><code>mv</code> = rename when same location</li>
</ul>
<h3>Common Mistake</h3>
<pre><code class="language-plaintext">mv file1.txt renamed.txt
</code></pre>
<p>👉 People think copy — WRONG</p>
<p>👉 It <strong>renames</strong>, original is gone</p>
<h3>mkdir + mv → move file</h3>
<p>Run:</p>
<pre><code class="language-plaintext">mkdir folder1
mv file2.txt folder1/
ls
</code></pre>
<p>🔸 Output:</p>
<pre><code class="language-plaintext">folder1  renamed.txt
</code></pre>
<p>Check inside:</p>
<pre><code class="language-plaintext">ls folder1
</code></pre>
<p>🔸 Output:</p>
<pre><code class="language-plaintext">file2.txt
</code></pre>
<p>🔸 Important:</p>
<ul>
<li><code>mv</code> = move when destination is folder</li>
</ul>
<p>🔸 Real-world use</p>
<p>Used in deployments to rename build files or move artifacts.</p>
<table>
<thead>
<tr>
<th>Destination</th>
<th>Result</th>
</tr>
</thead>
<tbody><tr>
<td>existing folder</td>
<td>move inside</td>
</tr>
<tr>
<td>new name</td>
<td>rename</td>
</tr>
</tbody></table>
<hr />
<h2>Day 3 – File Viewing Commands</h2>
<hr />
<h2>🔹 <code>cat</code></h2>
<p>🔸 What it does</p>
<p>Displays full content of a file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">cat &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">cat file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Hello DevOps
This is file content
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to quickly view small config or script files.</p>
<hr />
<h2>🔹 <code>less</code></h2>
<p>🔸 What it does</p>
<p>Displays file content in scrollable view.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">less &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">less /var/log/syslog
less file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># opens interactive scroll view 
</code></pre>
<p>🔸 Behavior:</p>
<ul>
<li><p>scroll with ↑ ↓</p>
</li>
<li><p>press <code>q</code> to exit</p>
</li>
</ul>
<p>🔸 Real-world use</p>
<p>Used for viewing large logs safely without flooding terminal.</p>
<hr />
<h2>🔹 <code>more</code></h2>
<p>🔸 What it does</p>
<p>Displays file content one screen at a time.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">more &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">more file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># shows content page by page 
</code></pre>
<p>🔸 Behavior:</p>
<ul>
<li><p>press <code>space</code> → next page</p>
</li>
<li><p>press <code>q</code> → exit</p>
</li>
</ul>
<p>🔸 Real-world use</p>
<ul>
<li><p>Used for reading large files in older systems.</p>
</li>
<li><p>Less powerful than <code>less</code></p>
</li>
</ul>
<hr />
<h2>🔹 <code>head</code></h2>
<p>🔸 What it does</p>
<p>Shows first lines of a file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">head &lt;file_name&gt;
head -n &lt;number&gt; &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">head -n 5 file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">line1
line2
line3
line4
line5
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to quickly inspect logs or config headers.</p>
<hr />
<h2>🔹 <code>tail</code></h2>
<p>🔸 What it does</p>
<p>Shows last lines of a file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">tail &lt;file_name&gt;
tail -n &lt;number&gt; &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">tail -n 10 app.log
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">last 10 log lines shown 
</code></pre>
<h3>tail -f &lt;file_name&gt;</h3>
<p>🔸 What it does</p>
<p>Shows live updates in -f</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">tail -f &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">tail -f app.log
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">last 10 log lines shown (live updates in -f)
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for live monitoring logs in production servers.</p>
<hr />
<h2>Day 4 – File Permissions &amp; Ownership</h2>
<hr />
<h2>🔹 <code>ls -l</code></h2>
<p>🔸 What it does</p>
<p>Shows detailed file information including permissions, owner, size, and timestamp.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ls -l
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ls -l
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">-rw-r--r-- 1 user user 120 Apr 10 file.txt
drwxr-xr-x 2 user user 4096 Apr 10 folder
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check file permissions before running scripts or debugging access issues.</p>
<hr />
<h2>🔹 <code>chmod</code></h2>
<p>🔸 What it does</p>
<p>Changes file permissions (read, write, execute).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">chmod &lt;permissions&gt; &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">chmod 755 script.sh
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># permissions updated
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to make scripts executable on servers.</p>
<hr />
<h2>🔹 <code>chmod 777</code></h2>
<p>🔸 What it does</p>
<p>Gives full read, write, execute permissions to everyone.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">chmod 777 &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">chmod 777 file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># full permissions granted
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in testing only (NOT safe for production).</p>
<hr />
<h2>🔹 <code>chmod +x</code></h2>
<p>🔸 What it does</p>
<p>Adds execute permission to a file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">chmod +x &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">chmod +x deploy.sh
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># file becomes executable
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to run shell scripts or automation scripts.</p>
<hr />
<h2>🔹 <code>chmod -w</code></h2>
<p>🔸 What it does</p>
<p>Removes write permission from file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">chmod -w &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">chmod -w file.txt # -rwxrwxrwx  (777)
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># write permission removed # -r-x r-x r-x  → 555
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to protect important configuration files.</p>
<hr />
<h2>🔹 <code>chown</code></h2>
<p>🔸 What it does</p>
<p>Changes file owner.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">chown &lt;user&gt; &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">chown ubuntu file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># ownership changed
</code></pre>
<p>🔸 Real-world use</p>
<p>Used when fixing permission issues on servers.</p>
<hr />
<h2>🔹 <code>chown user:group</code></h2>
<p>🔸 What it does</p>
<p>Changes both user and group ownership.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">chown &lt;user&gt;:&lt;group&gt; &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">chown user:devops file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># owner and group changed
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in multi-user server environments.</p>
<hr />
<h2>🔹 <code>chown :group</code></h2>
<p>🔸 What it does</p>
<p>Changes only group ownership.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">chown :&lt;group&gt; &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">chown :devops file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># group changed
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in shared team environments.</p>
<hr />
<h2>Day 5 – Users &amp; Groups Management</h2>
<hr />
<h2>🔹 <code>adduser</code></h2>
<p>🔸 What it does</p>
<p>Creates a new user with home directory and setup.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">adduser &lt;username&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo adduser devuser
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Adding user `devuser` ...
Creating home directory /home/devuser ...
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to create new system users for teams or applications.</p>
<p>DEBUG - Check user:</p>
<pre><code class="language-plaintext">id devuser
</code></pre>
<hr />
<h2>🔹 <code>useradd</code></h2>
<p>🔸 What it does</p>
<p>Creates a new user (low-level, no home directory by default).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">useradd &lt;username&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo useradd devuser
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># user created (no home directory by default)
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in automation scripts for user provisioning.</p>
<h2>useradd vs adduser</h2>
<h3>✔ Low-level</h3>
<pre><code class="language-plaintext">sudo useradd testuser
</code></pre>
<p>👉 No home directory</p>
<h3>✔ With home</h3>
<pre><code class="language-plaintext">sudo adduser testuser2
</code></pre>
<p>👉 Creates:</p>
<pre><code class="language-plaintext">/home/testuser2
</code></pre>
<hr />
<h3>IMPORTANT DIFFERENCE</h3>
<table>
<thead>
<tr>
<th>Command</th>
<th>Behavior</th>
</tr>
</thead>
<tbody><tr>
<td>adduser</td>
<td>friendly, creates home</td>
</tr>
<tr>
<td>useradd</td>
<td>raw, minimal</td>
</tr>
</tbody></table>
<hr />
<h2>🔹 <code>passwd</code></h2>
<p>🔸 What it does</p>
<p>Sets or changes user password.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">passwd &lt;username&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo passwd devuser
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Enter new UNIX password:
Password updated successfully
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to secure newly created accounts.</p>
<hr />
<h2>🔹 <code>usermod</code></h2>
<p>🔸 What it does</p>
<p>Modifies user account (groups, shell, home, etc.)</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">usermod -aG &lt;group&gt; &lt;username&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo usermod -aG sudo devuser
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># user added to group sudo
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to grant admin or Docker permissions.</p>
<h3>COMMON MISTAKES (AVOID NOW)</h3>
<p>❌ Using non-existing group in chown<br />✔ Always create group first</p>
<p>❌ Forgetting <code>-aG</code><br />✔ Without <code>-a</code>, user removed from other groups</p>
<h3>Problem: Forgetting <code>-a</code> in <code>usermod</code></h3>
<h3>❌ Wrong command</h3>
<pre><code class="language-plaintext">sudo usermod -G heistpolice alicia
</code></pre>
<p>👉 What happens:</p>
<ul>
<li><p><code>alicia</code> is added to <strong>heistpolice</strong></p>
</li>
<li><p>BUT removed from all other groups</p>
</li>
</ul>
<p>👉 This is dangerous</p>
<h2>PRACTICALLY</h2>
<h3>Step 1: Check current groups</h3>
<pre><code class="language-plaintext">groups alicia
</code></pre>
<p>👉 Example:</p>
<pre><code class="language-plaintext">alicia : alicia sudo users
</code></pre>
<hr />
<h3>Step 2: Run WRONG command</h3>
<pre><code class="language-plaintext">sudo usermod -G heistpolice alicia
</code></pre>
<hr />
<h3>Step 3: Check again</h3>
<pre><code class="language-plaintext">groups alicia
</code></pre>
<p>👉 Output:</p>
<pre><code class="language-plaintext">alicia : heistpolice
</code></pre>
<p>❌ Lost:</p>
<ul>
<li><p>sudo</p>
</li>
<li><p>users</p>
</li>
<li><p>default group access</p>
</li>
</ul>
<hr />
<h3>🔹 Correct command</h3>
<pre><code class="language-plaintext">sudo usermod -aG heistpolice alicia
</code></pre>
<hr />
<h3>Meaning</h3>
<table>
<thead>
<tr>
<th>Flag</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>-G</td>
<td>set groups</td>
</tr>
<tr>
<td>-a</td>
<td>append (add without removing existing)</td>
</tr>
</tbody></table>
<p>👉 So:</p>
<ul>
<li><p><code>-G</code> = overwrite / replaces</p>
</li>
<li><p><code>-aG</code> = add safely / appends (safe)</p>
</li>
</ul>
<hr />
<h2>HOW TO FIX IF YOU MADE MISTAKE</h2>
<h3>Add back groups</h3>
<pre><code class="language-plaintext">sudo usermod -aG sudo alicia
sudo usermod -aG users alicia
</code></pre>
<p>Then verify:</p>
<pre><code class="language-plaintext">groups alicia
</code></pre>
<hr />
<h2>🔹 <code>groups</code></h2>
<p>🔸 What it does</p>
<p>Shows groups a user belongs to.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">groups &lt;username&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">groups devuser
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">devuser : devuser sudo
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to verify access rights.</p>
<hr />
<h2>🔹 <code>id</code></h2>
<p>🔸 What it does</p>
<p>Shows user ID (UID), group ID (GID), and groups.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">id &lt;username&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">id devuser
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">uid=1001(devuser) gid=1001(devuser) groups=1001(devuser),27(sudo)
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for debugging permission issues.</p>
<hr />
<h2>🔹 <code>deluser</code></h2>
<p>🔸 What it does</p>
<p>Deletes a user from system.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">deluser &lt;username&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo deluser devuser
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Removing user `devuser` ...
Done.
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to remove unused or temporary accounts.</p>
<hr />
<h2>🔹 <code>groupadd</code></h2>
<p>🔸 What it does</p>
<p>Creates a new group.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">groupadd &lt;groupname&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo groupadd devops
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># group created
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to manage team-based permissions.</p>
<p>DEBUG-Check group:</p>
<pre><code class="language-plaintext">getent group devops
</code></pre>
<hr />
<h2>Day 6 – Package Management (Ubuntu/Debian)</h2>
<hr />
<h2>🔹 <code>apt update</code></h2>
<p>🔸 What it does</p>
<p>Refreshes package list from repositories.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">apt update
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo apt update
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Hit:1 http://archive.ubuntu.com/ubuntu ...
Reading package lists... Done
</code></pre>
<p>🔸 Real-world use</p>
<p>Used before installing or upgrading software to get latest package info.</p>
<hr />
<h2>🔹 <code>apt upgrade</code></h2>
<p>🔸 What it does</p>
<p>Upgrades installed packages to latest versions.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">apt upgrade
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo apt upgrade
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Calculating upgrade... Done
The following packages will be upgraded...
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to keep servers secure and updated.</p>
<hr />
<h2>🔹 <code>apt install</code></h2>
<p>🔸 What it does</p>
<p>Installs a new package.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">apt install &lt;package_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo apt install nginx
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Installing nginx...
Setting up nginx...
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to install tools like nginx, git, docker.</p>
<hr />
<h2>🔹 <code>apt remove</code></h2>
<p>🔸 What it does</p>
<p>Removes installed package but keeps config files.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">apt remove &lt;package_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo apt remove nginx
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Removing nginx...
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to uninstall unused software.</p>
<hr />
<h2>🔹 <code>apt purge</code></h2>
<p>🔸 What it does</p>
<p>Removes package along with configuration files.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">apt purge &lt;package_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo apt purge nginx
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Removing nginx and configuration files...
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for complete cleanup of software.</p>
<hr />
<h2>🔹 <code>apt autoremove</code></h2>
<p>🔸 What it does</p>
<p>Removes unused dependencies.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">apt autoremove
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sudo apt autoremove
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Removing unused packages...
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to free disk space on servers.</p>
<p>Note:</p>
<p>✔ <code>apt update</code> → updates list<br />✔ <code>apt upgrade</code> → upgrades packages<br />✔ <code>remove vs purge</code> → config difference<br />✔ <code>autoremove</code> → cleanup</p>
<hr />
<h2>Day 7 – Process Management</h2>
<hr />
<h2>🔹 <code>ps</code></h2>
<p>🔸What it does</p>
<p>Shows currently running processes (basic view).</p>
<p>🔸Syntax</p>
<pre><code class="language-plaintext">ps
</code></pre>
<p>🔸Example</p>
<pre><code class="language-plaintext">ps
</code></pre>
<p>🔸Output</p>
<pre><code class="language-plaintext">  PID TTY          TIME CMD
 1234 pts/0    00:00:00 bash
 2345 pts/0    00:00:00 ps
</code></pre>
<p>🔸Real-world use</p>
<p>Used to check running processes in current shell.</p>
<hr />
<h2>🔹 <code>ps aux</code></h2>
<p>🔸What it does</p>
<p>Shows all running processes in system with details.</p>
<p>🔸Syntax</p>
<pre><code class="language-plaintext">ps aux
</code></pre>
<p>🔸Example</p>
<pre><code class="language-plaintext">ps aux
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">root      1234  0.0  1.2  ... nginx
ubuntu    2345  0.1  0.5  ... bash
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for monitoring system-wide processes and CPU/memory usage.</p>
<hr />
<h2>🔹 <code>ps -ef</code></h2>
<p>🔸 What it does</p>
<p>Shows all processes in full format (parent-child structure).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ps -ef
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ps -ef
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">root  1234  1  0 10:00 ?  00:00:00 /usr/sbin/nginx
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in debugging services like Jenkins, Docker, system daemons.</p>
<hr />
<h2>🔹 <code>top</code></h2>
<p>🔸 What it does</p>
<p>Shows real-time system processes and resource usage.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">top
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">top
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># live interactive process monitoring screen
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to monitor CPU/memory usage in real time.</p>
<hr />
<h2>🔹 <code>kill</code></h2>
<p>🔸 What it does</p>
<p>Stops a process using PID.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">kill &lt;PID&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">kill 1234
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># process terminated
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to stop stuck or unwanted processes.</p>
<hr />
<h2>🔹 <code>kill -9</code></h2>
<p>🔸 What it does</p>
<p>Forcefully kills a process immediately.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">kill -9 &lt;PID&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">kill -9 1234
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># process force killed
</code></pre>
<p>🔸 Real-world use</p>
<p>Used when process does not stop normally.</p>
<hr />
<h2>🔹 <code>pkill</code></h2>
<p>🔸 What it does</p>
<p>Kills process by name.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">pkill &lt;process_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">pkill nginx
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># all nginx processes terminated
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to stop services quickly without PID.</p>
<hr />
<h2>🔹 <code>jobs</code></h2>
<p>🔸 What it does</p>
<p>Shows background jobs in current shell.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">jobs
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">jobs
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">[1]+ Running sleep 100 &amp;
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in shell scripting and background process tracking.</p>
<hr />
<h2>🔹 <code>fg</code></h2>
<p>🔸 What it does</p>
<p>Brings background job to foreground.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">fg
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">fg %1
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># job moved to foreground
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to resume paused jobs.</p>
<hr />
<h2>🔹 <code>bg</code></h2>
<p>🔸 What it does</p>
<p>Resumes a stopped job in background.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">bg
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">bg %1
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># job running in background
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in multitasking shell operations.</p>
<h2>🔹 bg behavior</h2>
<ul>
<li><p>works only on <strong>Stopped jobs</strong></p>
</li>
<li><p>gives error if already running</p>
</li>
</ul>
<h2>🔹 fg behavior</h2>
<ul>
<li>brings <strong>latest job (</strong><code>+</code><strong>)</strong> to foreground</li>
</ul>
<h2>🔹 jobs symbols</h2>
<table>
<thead>
<tr>
<th>Symbol</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td><code>+</code></td>
<td>current job</td>
</tr>
<tr>
<td><code>-</code></td>
<td>previous job</td>
</tr>
</tbody></table>
<p>Running → fg<br />Stopped → bg</p>
<h3>THINK LIKE THIS (VERY SIMPLE)</h3>
<p>Imagine a job like a <strong>task running in terminal</strong></p>
<p>There are only 3 states:</p>
<table>
<thead>
<tr>
<th>State</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>Running (foreground)</td>
<td>using your terminal</td>
</tr>
<tr>
<td>Running (background)</td>
<td>running behind</td>
</tr>
<tr>
<td>Stopped</td>
<td>paused</td>
</tr>
</tbody></table>
<hr />
<h3>ONLY 3 COMMANDS YOU NEED</h3>
<table>
<thead>
<tr>
<th>Command</th>
<th>Works on</th>
</tr>
</thead>
<tbody><tr>
<td><code>fg</code></td>
<td>bring job to front</td>
</tr>
<tr>
<td><code>bg</code></td>
<td>resume paused job</td>
</tr>
<tr>
<td><code>jobs</code></td>
<td>see jobs</td>
</tr>
</tbody></table>
<hr />
<h2>Day 8 – Disk &amp; Memory Management</h2>
<hr />
<h2>🔹 <code>df -h</code></h2>
<p>🔸 What it does</p>
<p>Shows disk usage in human-readable format.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">df -h
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">df -h
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Filesystem      Size  Used Avail Use%
/dev/sda1        50G   20G   28G  42%
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check disk space before deploying applications.</p>
<hr />
<h2>🔹 <code>df -Th</code></h2>
<p>🔸 What it does</p>
<p>Shows disk usage with filesystem type.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">df -Th
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">df -Th
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Filesystem     Type  Size  Used Avail Use%
/dev/sda1      ext4   50G   20G   28G  42%
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in server debugging to identify filesystem type (ext4, xfs).</p>
<hr />
<h2>🔹 <code>du -h</code></h2>
<p>🔸 What it does</p>
<p>Shows size disk usage of all files and folders inside.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">du -h
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">du -h folder/
du -h .
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">4.0K    file.txt
10M     folder/
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to find heavy files consuming disk space.</p>
<hr />
<h2>🔹 <code>du -sh</code></h2>
<p>🔸 What it does</p>
<p>Shows total size of a directory.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">du -sh &lt;folder&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">du -sh /var/log
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">120M    /var/log
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to quickly check heavy folder size (logs, backups).</p>
<hr />
<h2>🔹 <code>free -m</code></h2>
<p>🔸 What it does</p>
<p>Shows memory (RAM) usage in MB.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">free -m
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">free -m
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">              total   used   free
Mem:           2000   1200    500
Swap:          1024      0   1024
</code></pre>
<p>🔸 Real-world use</p>
<ul>
<li><p>Used to monitor RAM usage on servers.</p>
</li>
<li><p>Check memory before running app</p>
</li>
</ul>
<hr />
<h2>🔹 <code>lsblk</code></h2>
<p>🔸 What it does</p>
<p>Lists all block devices (disks, partitions).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">lsblk
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">lsblk
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">NAME   SIZE TYPE MOUNTPOINT
sda     50G disk
└─sda1  50G part /
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to identify attached disks and partitions.</p>
<hr />
<h2>🔹 <code>mount</code></h2>
<p>🔸 What it does</p>
<p>Attaches filesystem to directory.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">mount &lt;device&gt; &lt;directory&gt;
mount &lt;device&gt; &lt;mount_point&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">mount /dev/sdb1 /mnt
sudo mount /dev/sdb1 /mnt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># device mounted successfully
</code></pre>
<p>🔸 Real-world use</p>
<ul>
<li><p>Used when attaching external drives or storage volumes.</p>
</li>
<li><p>Attach new disk to server</p>
</li>
</ul>
<hr />
<h2>🔹 <code>umount</code></h2>
<p>🔸 What it does</p>
<p>Detaches mounted filesystem.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">umount &lt;device or directory&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">umount /dev/sdb1
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># device unmounted
</code></pre>
<p>🔸 Real-world use</p>
<p>Used before removing external storage safely.</p>
<hr />
<h2>Day 9 – Networking Commands</h2>
<hr />
<h2>🔹 <code>ip a</code></h2>
<p>🔸 What it does</p>
<p>Displays IP addresses and network interfaces.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ip a
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ip a
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">2: eth0: inet 192.168.1.10/24
3: lo: inet 127.0.0.1/8
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check server IP address for SSH, deployment, and networking.</p>
<hr />
<h2>🔹 <code>ifconfig</code></h2>
<p>🔸 What it does</p>
<p>Shows network interface configuration (older tool).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ifconfig
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ifconfig
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">eth0: inet 192.168.1.10
lo: inet 127.0.0.1
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in legacy systems to check network details.</p>
<hr />
<h2>🔹 <code>ping</code></h2>
<p>🔸 What it does</p>
<p>Checks connectivity to another server.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ping &lt;host&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ping google.com
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">64 bytes from google.com: time=20ms
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check if server or website is reachable.</p>
<hr />
<h2>🔹 <code>curl</code></h2>
<p>🔸 What it does</p>
<p>Transfers data from or to a server (API testing).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">curl &lt;url&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">curl https://example.com
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">&lt;html&gt;...&lt;/html&gt;
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in DevOps for API testing and health checks.</p>
<hr />
<h2>🔹 <code>wget</code></h2>
<p>🔸 What it does</p>
<p>Downloads files from internet.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">wget &lt;url&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">wget https://example.com/file.zip
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">file.zip downloaded successfully
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for downloading scripts, packages, and backups.</p>
<hr />
<h2>🔹 <code>netstat -tuln</code></h2>
<p>🔸 What it does</p>
<p>Shows open ports and listening services.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">netstat -tuln
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">netstat -tuln
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">tcp 0 0 0.0.0.0:80  LISTEN
tcp 0 0 0.0.0.0:22  LISTEN
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check which services are running on server ports.</p>
<hr />
<h2>🔹 <code>ss -tuln</code></h2>
<p>🔸 What it does</p>
<p>Modern replacement for netstat (socket statistics).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ss -tuln
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ss -tuln
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">LISTEN 0 128 0.0.0.0:22
LISTEN 0 128 0.0.0.0:80
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in modern Linux servers for port and socket monitoring.</p>
<hr />
<h2>🔹 <code>hostname</code></h2>
<p>🔸 What it does</p>
<p>Shows system hostname.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">hostname
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">hostname
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">dev-server-01
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to identify servers in clusters or cloud environments.</p>
<hr />
<h2>Day 10 – Search &amp; Text Processing Commands</h2>
<hr />
<h2>🔹 <code>grep</code></h2>
<p>🔸 What it does</p>
<p>Searches for a specific text inside a file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">grep "&lt;text&gt;" &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">grep "error" app.log
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">error: failed to connect
error: timeout occurred
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to find errors in logs during debugging.</p>
<hr />
<h2>🔹 <code>grep -i</code></h2>
<p>🔸 What it does</p>
<p>Searches text ignoring case sensitivity.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">grep -i "&lt;text&gt;" &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">grep -i "error" app.log
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">ERROR: failed
Error: timeout
</code></pre>
<p>🔸 Real-world use</p>
<p>Used when logs have mixed uppercase/lowercase entries.</p>
<hr />
<h2>🔹 <code>find</code></h2>
<p>🔸 What it does</p>
<p>Searches for files and directories.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">find &lt;path&gt; -name "&lt;filename&gt;"
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">find . -name file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">./docs/file.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to locate files in large project directories.</p>
<hr />
<h2>🔹 <code>find / -type f -name "*.log"</code></h2>
<p>🔸 What it does</p>
<p>Finds all log files in system.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">find / -type f -name "*.log"
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">find / -type f -name "*.log"
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">/var/log/syslog.log
/home/user/app.log
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in server troubleshooting to locate log files.</p>
<hr />
<h2>🔹 <code>wc</code></h2>
<p>🔸 What it does</p>
<p>Counts lines, words, and characters in a file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">wc &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">wc file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">10  50  300 file.txt
</code></pre>
<p>Meaning</p>
<ul>
<li><p>lines</p>
</li>
<li><p>words</p>
</li>
<li><p>bytes</p>
</li>
</ul>
<p>🔸 Real-world use</p>
<p>Used to analyze file size and content structure.</p>
<hr />
<h2>🔹 <code>wc -l</code></h2>
<p>🔸 What it does</p>
<p>Counts only number of lines.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">wc -l &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">wc -l file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">10 file.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to count logs, records, or entries.</p>
<hr />
<h2>🔹 <code>sort</code></h2>
<p>🔸 What it does</p>
<p>Sorts file content alphabetically or numerically.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">sort &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">sort file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">apple
banana
mango
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to organize data before processing.</p>
<hr />
<h2>🔹 <code>uniq</code></h2>
<p>🔸 What it does</p>
<p>Removes duplicate lines (requires sorted input).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">uniq &lt;file_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">uniq file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">apple
banana
mango
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in data cleaning and log analysis.</p>
<table>
<thead>
<tr>
<th>Problem</th>
<th>Reason</th>
<th>Fix</th>
</tr>
</thead>
<tbody><tr>
<td>grep no output</td>
<td>text not present</td>
<td>add text</td>
</tr>
<tr>
<td>wc error</td>
<td>file missing</td>
<td>create/check file</td>
</tr>
<tr>
<td>sort/uniq error</td>
<td>file missing</td>
<td>create file</td>
</tr>
<tr>
<td>find permission denied</td>
<td>no sudo</td>
<td>use sudo</td>
</tr>
</tbody></table>
<pre><code class="language-plaintext">echo -e "apple\nbanana\napple" &gt; names.txt
echo "this is text" &gt;&gt; file.txt

grep "text" file.txt
grep -i "TEXT" file.txt

find . -name file.txt
sudo find /var/log -type f -name "*.log"

wc file.txt
wc -l file.txt

sort names.txt
sort names.txt | uniq
</code></pre>
<hr />
<h2>Day 11 – Archiving, Compression &amp; Advanced Utilities</h2>
<hr />
<h2>🔹 <code>tar -cvf</code></h2>
<p>🔸 What it does</p>
<p>Creates an archive file (.tar) from a directory.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">tar -cvf &lt;archive_name.tar&gt; &lt;folder_name&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">tar -cvf backup.tar project/
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">project/file1.txt
project/file2.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to bundle project files for backup or transfer.</p>
<hr />
<h2>🔹 <code>tar -xvf</code></h2>
<p>🔸 What it does</p>
<p>Extracts files from a .tar archive.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">tar -xvf &lt;archive_name.tar&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">tar -xvf backup.tar
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">project/file1.txt
project/file2.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to restore backups or unpack applications.</p>
<hr />
<h2>🔹 <code>tar -czvf</code></h2>
<p>🔸 What it does</p>
<p>Creates compressed archive (.tar.gz using gzip).</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">tar -czvf &lt;archive.tar.gz&gt; &lt;folder&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">tar -czvf backup.tar.gz project/
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">project/file1.txt
project/file2.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for compressing backups to save storage space.</p>
<hr />
<h2>🔹 <code>tar -xzvf</code></h2>
<p>🔸 What it does</p>
<p>Extracts compressed .tar.gz files.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">tar -xzvf &lt;archive.tar.gz&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">tar -xzvf backup.tar.gz
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">project/file1.txt
project/file2.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to restore compressed backups.</p>
<hr />
<h2>🔹 <code>zip</code></h2>
<p>🔸 What it does</p>
<p>Creates a .zip compressed file.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">zip &lt;archive.zip&gt; &lt;file&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">zip file.zip file.txt
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">adding: file.txt (deflated 40%)
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for sharing compressed files across systems.</p>
<hr />
<h2>🔹 <code>unzip</code></h2>
<p>🔸 What it does</p>
<p>Extracts .zip files.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">unzip &lt;archive.zip&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">unzip file.zip
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">inflating: file.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to extract shared archives or downloads.</p>
<h3>DIFFERENCE</h3>
<p>tar vs zip</p>
<p>tar → Linux standard (no compression unless -z)<br />zip → cross-platform (Windows friendly)</p>
<p>zip → compress<br />unzip → extract</p>
<hr />
<h2>🔹 <code>history</code></h2>
<p>🔸 What it does</p>
<p>Shows previously executed commands.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">history
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">history
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">1  ls
2  cd /var
3  cat file.txt
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to repeat or audit past terminal actions.</p>
<hr />
<h2>🔹 <code>alias</code></h2>
<p>🔸 What it does</p>
<p>Creates shortcut for long commands.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">alias &lt;name&gt;='command'
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">alias ll='ls -la'
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># shortcut created
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to speed up frequently used commands.</p>
<hr />
<h2>🔹 <code>echo</code></h2>
<p>🔸 What it does</p>
<p>Prints text to terminal.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">echo "&lt;text&gt;"
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">echo "Hello DevOps"
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Hello DevOps
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in scripts for logging and debugging.</p>
<hr />
<h2>🔹 <code>env</code></h2>
<p>🔸 What it does</p>
<p>Shows environment variables.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">env
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">env
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">PATH=/usr/bin:/bin
HOME=/home/ubuntu
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check system environment configuration.</p>
<hr />
<h2>🔹 <code>export</code></h2>
<p>🔸 What it does</p>
<p>Sets environment variable.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">export VAR=value
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">export APP_ENV=production
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># variable set
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in CI/CD pipelines and deployment configs.</p>
<hr />
<h2>🔹 <code>man</code></h2>
<p>🔸 What it does</p>
<p>Shows manual pages for commands.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">man &lt;command&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">man ls
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext"># opens detailed documentation page
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to learn command options and usage.</p>
<hr />
<h2>🔹 <code>which</code></h2>
<p>🔸 What it does</p>
<p>Shows location of executable command.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">which &lt;command&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">which python3
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">/usr/bin/python3
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to verify installed software path.</p>
<hr />
<h2>🔹 <code>whereis</code></h2>
<p>🔸 What it does</p>
<p>Shows binary, source, and manual locations.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">whereis &lt;command&gt;
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">whereis nginx
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to locate full installation structure.</p>
<hr />
<h2>🔹 <code>uname -a</code></h2>
<p>🔸 What it does</p>
<p>Shows full system information.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">uname -a
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">uname -a
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Linux ubuntu 5.15.0-91-generic x86_64 GNU/Linux
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for server debugging and OS identification.</p>
<hr />
<h2>🔹 <code>uptime</code></h2>
<p>🔸 What it does</p>
<p>Shows how long system has been running.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">uptime
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">uptime
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">10:30:25 up 5 days, 3 users, load average: 0.10
</code></pre>
<p>🔸 Real-world use</p>
<p>Used to check server stability.</p>
<hr />
<h2>🔹 <code>df -Th</code></h2>
<p>🔸 What it does</p>
<p>Shows disk usage with filesystem types.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">df -Th
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">df -Th
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">Filesystem     Type  Size  Used Avail Use%
/dev/sda1      ext4   50G   20G   28G  42%
</code></pre>
<p>🔸 Real-world use</p>
<p>Used in storage and filesystem debugging.</p>
<hr />
<h2>🔹 <code>ps -ef</code></h2>
<p>🔸 What it does</p>
<p>Shows all running processes in full format.</p>
<p>🔸 Syntax</p>
<pre><code class="language-plaintext">ps -ef
</code></pre>
<p>🔸 Example</p>
<pre><code class="language-plaintext">ps -ef
</code></pre>
<p>🔸 Output</p>
<pre><code class="language-plaintext">root 1234 1 0 10:00 ? 00:00:00 nginx
</code></pre>
<p>🔸 Real-world use</p>
<p>Used for system debugging and service monitoring.</p>
<hr />
<h2>🔹grep vs find</h2>
<p>🔸 grep (inside)</p>
<p>Search inside file content</p>
<p>🔸 find (outside)</p>
<p>Search file location</p>
<hr />
<h2>🔹 chmod 777 risk</h2>
<p>✔ Gives full access to everyone</p>
<p>✔ Anyone can read/write/delete</p>
<p>- Never use in production</p>
<p>🔸 Better</p>
<pre><code class="language-plaintext">chmod 755 script.sh
</code></pre>
<hr />
<h2>🔹 kill vs kill -9</h2>
<p>🔸 kill</p>
<p>Graceful stop (cleanup allowed)</p>
<p>🔸 kill -9</p>
<p>Force stop (no cleanup)</p>
<p>🔸 Real-world</p>
<p>Use kill first, kill -9 only if stuck</p>
<p>🔸env → show variables<br />🔸export → set variable<br />🔸which → exact command path<br />whereis → all related locations</p>
<hr />
<h1>FINAL CHEAT SHEET</h1>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/78a593fa-84f0-4b5c-af90-c4dab9346ab1.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/16627285-b31b-4704-aa63-bc361b15d26c.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/74a83a03-07e7-42c5-bd06-27a464a62170.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b9ffef26-2a33-48e1-a0ea-01088d9bba6a.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/c6ab9399-8c9a-4559-823d-fd6f8fbab43e.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/cef92ea7-ea26-49fc-b38f-0e1e5870c69b.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/f5f3a7d5-a18e-4128-be23-b9beb1496151.png" alt="" style="display:block;margin:0 auto" />

<hr />
<p>Refer: <a href="https://90-days-devops-with-shubham.hashnode.dev/revision-days-01-11">https://90-days-devops-with-shubham.hashnode.dev/revision-days-01-11</a></p>
]]></content:encoded></item><item><title><![CDATA[Day 11 – Understanding File Ownership in Linux (chown & chgrp) ]]></title><description><![CDATA[When I started learning Linux for DevOps, one thing confused me a lot:
👉 Who actually controls a file?👉 Why do permission errors happen?👉 What are owner and group?

What is File Ownership in Linux?]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-11-understanding-file-ownership-in-linux-chown-chgrp</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-11-understanding-file-ownership-in-linux-chown-chgrp</guid><category><![CDATA[#DevOps #AWS #90DaysOfDevOps #TrainWithShubham #GitHub #Git #Basics of Git]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Wed, 15 Apr 2026 17:27:17 GMT</pubDate><content:encoded><![CDATA[<p>When I started learning Linux for DevOps, one thing confused me a lot:</p>
<p>👉 <em>Who actually controls a file?</em><br />👉 <em>Why do permission errors happen?</em><br />👉 <em>What are owner and group?</em></p>
<hr />
<h3>What is File Ownership in Linux?</h3>
<p>In Linux, <strong>every file and directory has two identities</strong>:</p>
<h3>👤 Owner (User)</h3>
<ul>
<li><p>The person who <strong>created the file</strong></p>
</li>
<li><p>Has <strong>full control</strong> over it (edit, delete, change permissions)</p>
</li>
</ul>
<h3>👥 Group</h3>
<ul>
<li><p>A <strong>collection of users</strong></p>
</li>
<li><p>Used to <strong>share access</strong> with multiple people</p>
</li>
</ul>
<p>👉 Think of it like this:</p>
<ul>
<li><p>Owner = <strong>File boss</strong></p>
</li>
<li><p>Group = <strong>Team working on the file</strong></p>
</li>
</ul>
<hr />
<h3>Understanding <code>ls -l</code></h3>
<p>Run this command:</p>
<pre><code class="language-bash">ls -l
</code></pre>
<p>Example output:</p>
<pre><code class="language-plaintext">-rw-r--r-- 1 user user 12 Feb 3 14:25 day-11.txt
</code></pre>
<h3>Breakdown (Simple Terms)</h3>
<table>
<thead>
<tr>
<th>Part</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td><code>-rw-r--r--</code></td>
<td>File permissions</td>
</tr>
<tr>
<td><code>1</code></td>
<td>Number of links</td>
</tr>
<tr>
<td><code>user</code></td>
<td>Owner</td>
</tr>
<tr>
<td><code>user</code></td>
<td>Group</td>
</tr>
<tr>
<td><code>12</code></td>
<td>File size</td>
</tr>
<tr>
<td><code>Feb 3</code></td>
<td>Last modified</td>
</tr>
<tr>
<td><code>day-11.txt</code></td>
<td>File name</td>
</tr>
</tbody></table>
<p>👉 The <strong>3rd column = Owner</strong><br />👉 The <strong>4th column = Group</strong></p>
<hr />
<h3>Step-by-Step Hands-On Practice</h3>
<p>Let’s go through everything practically.</p>
<hr />
<h2>🔹 Step 1: Create a File</h2>
<pre><code class="language-bash">touch devops-file.txt
</code></pre>
<p>👉 This creates an empty file.</p>
<hr />
<h2>🔹 Step 2: Check Ownership</h2>
<pre><code class="language-bash">ls -l devops-file.txt
</code></pre>
<p>👉 You’ll see your current user as the owner.</p>
<hr />
<h2>🔹 Step 3: Create Users</h2>
<pre><code class="language-bash">sudo useradd -m tokyo
sudo useradd -m berlin
</code></pre>
<h3>Why do we create users?</h3>
<p>Because:</p>
<ul>
<li><p>Linux cannot assign ownership to someone who doesn’t exist</p>
</li>
<li><p>Every file must belong to a valid user</p>
</li>
</ul>
<hr />
<h2>🔹 Step 4: Change File Owner (<code>chown</code>)</h2>
<pre><code class="language-bash">sudo chown tokyo devops-file.txt
</code></pre>
<p>👉 Now:</p>
<ul>
<li><strong>tokyo becomes the owner</strong></li>
</ul>
<p>Change again:</p>
<pre><code class="language-bash">sudo chown berlin devops-file.txt
</code></pre>
<p>👉 Ownership shifts to <strong>berlin</strong></p>
<hr />
<h2>👥 Changing Group Ownership (<code>chgrp</code>)</h2>
<h3>🔹 Step 1: Create a File</h3>
<pre><code class="language-bash">touch team-notes.txt
</code></pre>
<h3>🔹 Step 2: Create a Group</h3>
<pre><code class="language-bash">sudo groupadd heist-team
</code></pre>
<h3>Why groups?</h3>
<p>Imagine:</p>
<ul>
<li>5 developers working on same file</li>
</ul>
<p>Without groups:<br />- Give permission one by one</p>
<p>With groups:<br />- Add all users to one group<br />- Assign permission once</p>
<hr />
<h3>🔹 Step 3: Change Group</h3>
<pre><code class="language-bash">sudo chgrp heist-team team-notes.txt
</code></pre>
<p>👉 Now:</p>
<ul>
<li>File belongs to <strong>heist-team group</strong></li>
</ul>
<hr />
<h2>Changing Owner + Group Together</h2>
<p>Instead of running two commands, we can do it in one:</p>
<pre><code class="language-bash">sudo chown professor:heist-team project-config.yaml
</code></pre>
<p>👉 This sets:</p>
<ul>
<li><p>Owner → professor</p>
</li>
<li><p>Group → heist-team</p>
</li>
</ul>
<hr />
<h3>Working with Directories</h3>
<pre><code class="language-bash">mkdir app-logs
sudo chown berlin:heist-team app-logs
</code></pre>
<h3>Why is this important?</h3>
<p>Because:</p>
<ul>
<li><p>Applications write logs inside folders</p>
</li>
<li><p>Wrong ownership = app cannot write logs</p>
</li>
</ul>
<hr />
<h2>Recursive Ownership</h2>
<h3>Create structure</h3>
<pre><code class="language-bash">mkdir -p heist-project/vault
mkdir -p heist-project/plans
touch heist-project/vault/gold.txt
touch heist-project/plans/strategy.conf
</code></pre>
<h3>Create group</h3>
<pre><code class="language-bash">sudo groupadd planners
</code></pre>
<h3>Apply ownership to everything</h3>
<pre><code class="language-bash">sudo chown -R professor:planners heist-project/
</code></pre>
<h3>What does <code>-R</code> do?</h3>
<ul>
<li>Applies changes to <strong>all files and subdirectories</strong></li>
</ul>
<p>👉 Without <code>-R</code>:</p>
<ul>
<li>Only main folder changes</li>
</ul>
<p>👉 With <code>-R</code>:</p>
<ul>
<li>Everything updates</li>
</ul>
<hr />
<h3>Real-Life Practice Scenario</h3>
<p>Let’s simulate a real-world team setup.</p>
<h2>Create project</h2>
<pre><code class="language-bash">mkdir bank-heist
touch bank-heist/access-codes.txt
touch bank-heist/blueprints.pdf
touch bank-heist/escape-plan.txt
</code></pre>
<h2>Create users &amp; groups</h2>
<pre><code class="language-bash">sudo useradd -m nairobi
sudo groupadd vault-team
sudo groupadd tech-team
</code></pre>
<h2>Assign ownership</h2>
<pre><code class="language-bash">sudo chown tokyo:vault-team bank-heist/access-codes.txt
sudo chown berlin:tech-team bank-heist/blueprints.pdf
sudo chown nairobi:vault-team bank-heist/escape-plan.txt
</code></pre>
<p>👉 Now:</p>
<ul>
<li><p>Different files are controlled by different people</p>
</li>
<li><p>Teams manage access efficiently</p>
</li>
</ul>
<hr />
<h2>Common Errors &amp; Fixes</h2>
<h3>User does not exist</h3>
<pre><code class="language-bash">sudo useradd username
</code></pre>
<h3>Group does not exist</h3>
<pre><code class="language-bash">sudo groupadd groupname
</code></pre>
<h3>Permission denied</h3>
<pre><code class="language-bash">sudo command
</code></pre>
<hr />
<h2>Key Learnings</h2>
<ul>
<li><p><strong>Owner</strong> = main controller of file</p>
</li>
<li><p><strong>Group</strong> = shared access for team</p>
</li>
<li><p><code>chown</code> = change owner</p>
</li>
<li><p><code>chgrp</code> = change group</p>
</li>
<li><p><code>chown user:group</code> = change both</p>
</li>
<li><p><code>-R</code> = apply changes recursively</p>
</li>
</ul>
<hr />
<h3>Why This Matters in DevOps</h3>
<p>File ownership is critical for:</p>
<ul>
<li><p>Application deployments</p>
</li>
<li><p>Shared team environments</p>
</li>
<li><p>CI/CD pipelines</p>
</li>
<li><p>Docker/container permissions</p>
</li>
<li><p>Log file handling</p>
</li>
</ul>
<p>👉 If ownership is wrong → applications fail<br />👉 If ownership is correct → systems run smoothly</p>
<hr />
<p>Learning file ownership changed how I see Linux systems.</p>
<p>It’s not just commands — it’s about:<br />👉 <strong>Control</strong><br />👉 <strong>Security</strong><br />👉 <strong>Collaboration</strong></p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 10 – Understanding Linux File Permissions ]]></title><description><![CDATA[When I started learning Linux, file permissions always felt confusing. That rwxrwxrwx format looked intimidating at first, but today (Day 10 of my DevOps journey), things finally started making sense.]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-10-understanding-linux-file-permissions</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-10-understanding-linux-file-permissions</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Wed, 15 Apr 2026 17:13:33 GMT</pubDate><content:encoded><![CDATA[<p>When I started learning Linux, file permissions always felt confusing. That <code>rwxrwxrwx</code> format looked intimidating at first, but today (Day 10 of my DevOps journey), things finally started making sense.</p>
<p>I practiced — creating files, reading them, and most importantly, understanding and modifying permissions.</p>
<hr />
<h2>🔹 Step 1: Creating Files</h2>
<p>I began with basic file creation using different commands:</p>
<pre><code class="language-bash">touch devops.txt
echo "These are my DevOps notes" &gt; notes.txt
vim script.sh
</code></pre>
<p>Inside <code>vim</code>, I added:</p>
<pre><code class="language-bash">echo "Hello DevOps"
</code></pre>
<p>Then saved using:</p>
<pre><code class="language-plaintext">ESC + :wq
</code></pre>
<p>To verify everything:</p>
<pre><code class="language-bash">ls -l
</code></pre>
<hr />
<h2>🔹 Step 2: Reading Files</h2>
<p>Next, I explored different ways to read files:</p>
<pre><code class="language-bash">cat notes.txt
vim -R script.sh
head -n 5 /etc/passwd
tail -n 5 /etc/passwd
</code></pre>
<p>This helped me understand:</p>
<ul>
<li><p><code>cat</code> → shows full content</p>
</li>
<li><p><code>head</code> → shows first few lines</p>
</li>
<li><p><code>tail</code> → shows last few lines</p>
</li>
</ul>
<p>Also, checking <code>/etc/passwd</code> gave a glimpse into how Linux stores user information.</p>
<hr />
<h2>🔹 Step 3: Understanding Permissions</h2>
<p>Running:</p>
<pre><code class="language-bash">ls -l devops.txt notes.txt script.sh
</code></pre>
<p>Output looked like this:</p>
<pre><code class="language-plaintext">-rw-r--r-- devops.txt
-rw-r--r-- notes.txt
-rw-r--r-- script.sh
</code></pre>
<p>At first, it looked confusing — but breaking it down helped:</p>
<ul>
<li><p><code>rw-</code> → Owner can read &amp; write</p>
</li>
<li><p><code>r--</code> → Group can only read</p>
</li>
<li><p><code>r--</code> → Others can only read</p>
</li>
</ul>
<p>No execute (<code>x</code>) permission meant I couldn’t run the script yet.</p>
<hr />
<h2>🔹 Step 4: Modifying Permissions</h2>
<p>This was the most interesting part.</p>
<h3>Make script executable:</h3>
<pre><code class="language-bash">chmod +x script.sh
./script.sh
</code></pre>
<h3>Make file read-only:</h3>
<pre><code class="language-bash">chmod a-w devops.txt
</code></pre>
<h3>Set specific permissions:</h3>
<pre><code class="language-bash">chmod 640 notes.txt
</code></pre>
<h3>Create a directory with permissions:</h3>
<pre><code class="language-bash">mkdir project
chmod 755 project
</code></pre>
<p>Now things started to feel practical — I could actually control who can access what.</p>
<hr />
<h2>🔹 Step 5: Testing Permissions (Real Learning Happens Here)</h2>
<p>I tried doing things I <em>shouldn’t</em> be able to do.</p>
<h3>Writing to a read-only file:</h3>
<pre><code class="language-bash">echo "test" &gt;&gt; devops.txt
</code></pre>
<p>Result:</p>
<pre><code class="language-plaintext">Permission denied
</code></pre>
<h3>Running a script without execute permission:</h3>
<pre><code class="language-bash">chmod -x script.sh
./script.sh
</code></pre>
<p>Again:</p>
<pre><code class="language-plaintext">Permission denied
</code></pre>
<p>This is where the concept really clicked.</p>
<hr />
<h2>🔹 Understanding Permission Numbers</h2>
<p>Linux uses numbers to represent permissions:</p>
<ul>
<li><p><code>r = 4</code></p>
</li>
<li><p><code>w = 2</code></p>
</li>
<li><p><code>x = 1</code></p>
</li>
</ul>
<p>So:</p>
<ul>
<li><p><code>7 = rwx</code></p>
</li>
<li><p><code>6 = rw-</code></p>
</li>
<li><p><code>5 = r-x</code></p>
</li>
<li><p><code>4 = r--</code></p>
</li>
</ul>
<h3>Examples:</h3>
<ul>
<li><p><code>755</code> → rwxr-xr-x (common for directories)</p>
</li>
<li><p><code>640</code> → rw-r----- (restricted access)</p>
</li>
<li><p><code>444</code> → read-only</p>
</li>
</ul>
<hr />
<h2>🔹 What I Learned</h2>
<ul>
<li><p>File permissions are essential for system security</p>
</li>
<li><p><code>chmod</code> helps control access using symbolic and numeric methods</p>
</li>
<li><p>Execute permission is required to run scripts</p>
</li>
<li><p>Errors like <em>Permission denied</em> are actually helpful for learning</p>
</li>
<li><p>Using <code>ls -l</code> regularly makes everything clearer</p>
</li>
</ul>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 08 – Cloud Server Setup: Docker, Nginx & Web Deployment Task]]></title><description><![CDATA[I Deployed My First Cloud Server — And Finally Understood What I Was Doing
Until today, I was just running commands and hoping things worked.
ssh this… install that… open port 80…
Things worked — but ]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-08-cloud-server-setup-docker-nginx-web-deployment-task</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-08-cloud-server-setup-docker-nginx-web-deployment-task</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Wed, 15 Apr 2026 17:09:46 GMT</pubDate><content:encoded><![CDATA[<h3>I Deployed My First Cloud Server — And Finally Understood What I Was Doing</h3>
<p>Until today, I was just running commands and hoping things worked.</p>
<p><code>ssh this… install that… open port 80…</code></p>
<p>Things worked — but I didn’t really <em>understand</em> what was happening.</p>
<p>So I decided to slow down and ask:</p>
<p>👉 What am I actually doing?<br />👉 Why does this work?</p>
<hr />
<h2>So… What is a Cloud Server?</h2>
<p>A cloud server is simply <strong>someone else’s computer that you can control over the internet</strong>.</p>
<p>Instead of using your own laptop, you rent a machine from a cloud provider and access it remotely.</p>
<p>Think of it like this:</p>
<ul>
<li><p>Your laptop = your personal device</p>
</li>
<li><p>Cloud server = a computer sitting in a data center somewhere in the world</p>
</li>
</ul>
<p>And you control it from your terminal.</p>
<p>That’s exactly what I did.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/f5ba7607-767d-4c08-9ffb-ab4a07faf355.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>Connecting to My Server (SSH)</h2>
<p>To connect to the server, I used:</p>
<pre><code class="language-plaintext">ssh -i key.pem ubuntu@&lt;ip&gt;
</code></pre>
<p>At first, it looked complicated. But breaking it down helped:</p>
<ul>
<li><p><code>ssh</code> → secure connection</p>
</li>
<li><p><code>-i key.pem</code> → authentication key</p>
</li>
<li><p><code>ubuntu@ip</code> → login user + server</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/a661e8a1-4bf4-4717-8dd1-cd7d981c9d8e.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>Why did I run <code>chmod 400 key.pem</code>?</h3>
<p>This confused me at first.</p>
<p>But here’s the simple reason:</p>
<p>SSH wants your key to be <strong>private</strong>.</p>
<p>If others can read it, it refuses to connect.</p>
<p>So:</p>
<pre><code class="language-plaintext">chmod 400 key.pem
</code></pre>
<p>means: 👉 “Only I can read this file”</p>
<p>Like locking your house key so no one else can use it.</p>
<hr />
<h2>Why My Website Didn’t Open (Firewall Reality Check)</h2>
<p>After installing Nginx, I opened my browser…</p>
<p>Nothing.</p>
<p>That’s when I learned about <strong>Security Groups (firewalls).</strong></p>
<p>Think of it like:</p>
<ul>
<li><p>Your server = a building</p>
</li>
<li><p>Ports = doors</p>
</li>
</ul>
<p>If the door is closed, no one can enter.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/cb068b98-7e79-48a0-8149-e9f98da15261.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>Ports I Used</h3>
<table>
<thead>
<tr>
<th>Port</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td>22</td>
<td>SSH (for me)</td>
</tr>
<tr>
<td>80</td>
<td>Website (for users)</td>
</tr>
</tbody></table>
<p>Once I opened port 80 → the website worked instantly.</p>
<hr />
<h2>Installing Software (What is sudo, apt?)</h2>
<p>I ran:</p>
<pre><code class="language-plaintext">sudo apt update &amp;&amp; sudo apt upgrade -y
</code></pre>
<p>At first, it felt like a ritual.</p>
<p>Then I understood:</p>
<h3><code>sudo</code></h3>
<p>Means: 👉 “Run as admin”</p>
<p>Without it, I don’t have permission to install software.</p>
<hr />
<h3><code>apt</code></h3>
<p>It’s like the <strong>Play Store of Linux</strong></p>
<ul>
<li><p>Want software? → install via apt</p>
</li>
<li><p>It handles dependencies automatically</p>
</li>
</ul>
<hr />
<h3>Why not yum?</h3>
<p>Because:</p>
<ul>
<li><p>Ubuntu uses <code>apt</code></p>
</li>
<li><p>Other systems use <code>yum</code> or <code>dnf</code></p>
</li>
</ul>
<p>Different OS → different package managers.</p>
<hr />
<h3>Update vs Upgrade</h3>
<p>This was important:</p>
<ul>
<li><p><code>update</code> → refresh list of packages</p>
</li>
<li><p><code>upgrade</code> → install latest versions</p>
</li>
</ul>
<p>They are NOT the same.</p>
<hr />
<h3><code>-y</code> flag</h3>
<p>Means: 👉 “Say yes to everything automatically”</p>
<p>Very useful for automation.</p>
<hr />
<h2>My First Web Server (Nginx)</h2>
<p>I installed Nginx and opened:</p>
<pre><code class="language-plaintext">http://&lt;my-ip&gt;
</code></pre>
<p>And suddenly…</p>
<p>My first live webpage.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/439ca3fa-7811-4815-9454-6fb1dcc01ec7.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>What is Nginx?</h3>
<p>It’s a web server.</p>
<p>It takes requests from users and shows web pages.</p>
<hr />
<h3>Where is the website stored?</h3>
<pre><code class="language-plaintext">/var/www/html
</code></pre>
<p>This folder contains the content users see.</p>
<hr />
<h2>Docker — Where Things Got Confusing</h2>
<p>Then I used Docker.</p>
<p>And honestly… I had no idea what was happening at first.</p>
<hr />
<h2>The Breakthrough: Host vs Container</h2>
<p>Here’s what finally made sense:</p>
<ul>
<li><p><strong>Host</strong> = my main server (EC2)</p>
</li>
<li><p><strong>Container</strong> = a small isolated environment inside it</p>
</li>
</ul>
<p>Think of it like:</p>
<ul>
<li><p>Server = building</p>
</li>
<li><p>Containers = rooms</p>
</li>
</ul>
<p>Each room runs its own application.</p>
<hr />
<h2>Port Mapping (The Moment It Clicked)</h2>
<p>I ran:</p>
<pre><code class="language-plaintext">docker run -d -p 8081:80 --name apache-server httpd
</code></pre>
<p>And this confused me the most.</p>
<hr />
<h3>What does <code>8081:80</code> mean?</h3>
<ul>
<li><p>8081 → outside world</p>
</li>
<li><p>80 → inside container</p>
</li>
</ul>
<hr />
<h3>How it actually works</h3>
<p>When I open:</p>
<pre><code class="language-plaintext">http://&lt;ip&gt;:8081
</code></pre>
<p>The request flows like this:</p>
<pre><code class="language-plaintext">Browser → Server (8081) → Container (80) → Apache
</code></pre>
<p>So Docker is basically saying:</p>
<p>👉 “Take traffic from 8081 and send it to 80 inside the container”</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/e60e6a16-e839-455c-84bf-4986f52207c5.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>Everything Connected</h2>
<pre><code class="language-plaintext">            Internet
               |
        ----------------
        |   EC2 Server |
        ----------------
         |     |     |
        80    8080  8081
         |      |      |
      Nginx   Docker  Docker
      (Host)  Nginx   Apache
</code></pre>
<hr />
<h2>Problems I Faced (And Learned From)</h2>
<h3>Nginx not loading</h3>
<p>→ Fixed by opening port 80</p>
<hr />
<h3>Docker permission error</h3>
<p>→ Fixed by adding user to docker group</p>
<hr />
<h3>Port already in use</h3>
<p>→ Learned that ports must be unique</p>
<hr />
<h3>Container name conflict</h3>
<p>→ Learned containers must have unique names</p>
<hr />
<h2>Logs — The Most Underrated Skill</h2>
<p>I checked:</p>
<pre><code class="language-plaintext">/var/log/nginx/access.log
</code></pre>
<hr />
<h3>What are logs?</h3>
<p>Logs are records of what happened.</p>
<hr />
<h3>Types:</h3>
<ul>
<li><p>access.log → who visited</p>
</li>
<li><p>error.log → what failed</p>
</li>
</ul>
<hr />
<h3>Downloading logs</h3>
<pre><code class="language-plaintext">scp -i key.pem ubuntu@IP:~/nginx-logs.txt .
</code></pre>
<p>The <code>.</code> means: 👉 “Download to my current folder”</p>
<hr />
<h2>What Changed for Me</h2>
<p>Before today:</p>
<ul>
<li>I was just following steps</li>
</ul>
<p>After today:</p>
<ul>
<li>I understand systems</li>
</ul>
<hr />
<h2>What I Can Do Now</h2>
<ul>
<li><p>Deploy a real cloud server</p>
</li>
<li><p>Run multiple applications</p>
</li>
<li><p>Understand ports and networking</p>
</li>
<li><p>Debug issues using logs</p>
</li>
</ul>
<hr />
<h2>Final Thought</h2>
<p>DevOps is not about commands.</p>
<p>It’s about understanding:</p>
<p>👉 How things connect<br />👉 Why things break<br />👉 How to fix them</p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 08 – I Deployed My First Cloud Server (And Finally Understood What I Was Doing)]]></title><description><![CDATA[Today felt different.
Until now, I was just typing commands… hoping things would work.
Sometimes they did.Most times, I didn’t even know why.
There was no clarity.No confidence.Just trial and error.
B]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-08-i-deployed-my-first-cloud-server-and-finally-understood-what-i-was-doing</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-08-i-deployed-my-first-cloud-server-and-finally-understood-what-i-was-doing</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Tue, 14 Apr 2026 18:51:05 GMT</pubDate><content:encoded><![CDATA[<p>Today felt different.</p>
<p>Until now, I was just typing commands… hoping things would work.</p>
<p>Sometimes they did.<br />Most times, I didn’t even know <em>why</em>.</p>
<p>There was no clarity.<br />No confidence.<br />Just trial and error.</p>
<p>But today, I stopped and asked:</p>
<p>🔸 What am I actually doing?<br />🔸 Why am I doing this?</p>
<p>And that changed everything.</p>
<p>This blog is not just steps —<br />it’s what I <em>understood while doing it</em>.</p>
<hr />
<h3>What Even Is a Cloud Server?</h3>
<p>Before today, my understanding was very simple:</p>
<blockquote>
<p>“Cloud = something online”</p>
</blockquote>
<p>But now I see it differently.</p>
<p>A cloud server is just <strong>someone else’s computer</strong><br />that you can control over the internet.</p>
<p>I used an EC2 instance from AWS.</p>
<p>Think of it like this:</p>
<ul>
<li><p>Your laptop → your personal computer</p>
</li>
<li><p>EC2 instance → a rented computer in a data center</p>
</li>
</ul>
<p>And the best part?</p>
<p>👉 You can access it from anywhere.</p>
<p>That means:</p>
<blockquote>
<p>I don’t own the machine — I just control it remotely.</p>
</blockquote>
<hr />
<h3>Connecting to EC2 via Computer (SSH)</h3>
<p>Now the next question:</p>
<p>👉 How do I control that remote computer?</p>
<p>I need a way to connect to it from my laptop.</p>
<p>That’s where <strong>SSH</strong> comes in.</p>
<hr />
<h3>Command I used:</h3>
<pre><code class="language-plaintext">ssh -i key.pem ubuntu@&lt;ip&gt;
</code></pre>
<p>At first, this looked scary.</p>
<p>But when I broke it down, it made sense:</p>
<ul>
<li><code>ssh</code><br />🔹 Stands for <strong>Secure Shell</strong><br />🔹 It is a protocol used to <strong>connect to another computer securely over the internet</strong></li>
</ul>
<p>In simple words:</p>
<blockquote>
<p>“Open a secure connection to another machine”</p>
</blockquote>
<ul>
<li><p><code>-i</code><br />🔹 Stands for <strong>identity file</strong><br />🔹 Tells SSH: <em>which private key to use</em></p>
</li>
<li><p><code>key.pem</code><br />🔹This is my <strong>private key file</strong><br />🔹 It acts like a secret <strong>password file</strong>, but more secure</p>
</li>
</ul>
<p>Without this file → I cannot log in</p>
<ul>
<li><code>ubuntu@&lt;ip&gt;</code><br />🔹<code>ubuntu</code> → username on the server<br />🔹 <code>&lt;ip&gt;</code> → public IP of the server</li>
</ul>
<p>Meaning:</p>
<blockquote>
<p>“Login as user <code>ubuntu</code> on this server”</p>
</blockquote>
<h3>Final Meaning of Full Command</h3>
<pre><code class="language-plaintext">ssh -i key.pem ubuntu@&lt;ip&gt;
</code></pre>
<p>Means:</p>
<blockquote>
<p>“Connect securely to this server using my private key and log in as ubuntu user.”</p>
</blockquote>
<hr />
<h3>Why Did I Run This?</h3>
<pre><code class="language-plaintext">chmod 400 key.pem
</code></pre>
<p>This confused me a lot at first.</p>
<hr />
<h3>Breaking it down</h3>
<ul>
<li><p><code>chmod</code><br />🔹 Stands for <strong>change mode</strong><br />🔹 Used to change <strong>file permissions</strong></p>
</li>
<li><p><code>400</code> → permission code<br />🔹 This is a permission code.</p>
<p>🔹 It has 3 parts:</p>
<ul>
<li><p>First digit → owner</p>
</li>
<li><p>Second → group</p>
</li>
<li><p>Third → others</p>
</li>
</ul>
<p>So:</p>
<ul>
<li><p><code>4</code> → read permission</p>
</li>
<li><p><code>0</code> → no permission</p>
</li>
<li><p><code>0</code> → no permission</p>
</li>
</ul>
</li>
</ul>
<pre><code class="language-plaintext">chmod 400 key.pem
</code></pre>
<p>Meaning:</p>
<blockquote>
<p>“Only the owner can read this file. No one else has any access.</p>
</blockquote>
<hr />
<h3>Why is this needed?</h3>
<p>Because:</p>
<ul>
<li><p>SSH requires your key to be <strong>private</strong> key to be <strong>completely secure</strong></p>
</li>
<li><p>If others can read it → SSH blocks access</p>
</li>
</ul>
<p>🔸 Think of it like:<br />A house key that only you should have</p>
<hr />
<h3>Firewall (Security Groups)</h3>
<p>Next confusion hit me hard:</p>
<p>👉 Why is my website not opening?</p>
<p>Everything looked correct… but still not working.</p>
<p>The answer was:</p>
<p>👉 <strong>Firewall</strong></p>
<p>In AWS, this is called <strong>Security Groups</strong></p>
<hr />
<h3>Simple Analogy</h3>
<ul>
<li><p>Server = building</p>
</li>
<li><p>Ports = doors</p>
</li>
</ul>
<p>If the door is closed → nobody can enter</p>
<hr />
<h2>Ports I Used</h2>
<table>
<thead>
<tr>
<th>Port</th>
<th>Purpose</th>
</tr>
</thead>
<tbody><tr>
<td>22</td>
<td>SSH (for login)</td>
</tr>
<tr>
<td>80</td>
<td>Website (for users)</td>
</tr>
</tbody></table>
<p>👉 If port 80 is closed → website will not load<br />And that’s exactly what happened to me.</p>
<hr />
<h3>Installing Software (What is sudo, apt?)</h3>
<p>Then I ran:</p>
<pre><code class="language-plaintext">sudo apt update &amp;&amp; sudo apt upgrade -y
</code></pre>
<p>At first… it looked like magic.</p>
<p>So I broke it down step-by-step.</p>
<hr />
<h3>Step 1: sudo</h3>
<p><code>sudo</code>:</p>
<blockquote>
<p>Stands for <strong>superuser do</strong></p>
<p>Runs command with <strong>admin privileges</strong></p>
</blockquote>
<p>Think of it like:</p>
<blockquote>
<ul>
<li><p>normal user → guest</p>
</li>
<li><p>sudo → admin</p>
</li>
</ul>
</blockquote>
<hr />
<h2>Step 2: apt</h2>
<p><code>apt</code>:</p>
<ul>
<li>A <strong>package manager</strong> used in Ubuntu</li>
</ul>
<p>👉 Think of it like:<br />Play Store for Linux</p>
<ul>
<li><p>Want software → use <code>apt</code></p>
</li>
<li><p>It downloads and installs automatically</p>
</li>
</ul>
<hr />
<h3>Why not yum?</h3>
<p>Because:</p>
<ul>
<li><p>Ubuntu → uses <code>apt</code></p>
</li>
<li><p>RedHat/CentOS → uses <code>yum</code></p>
</li>
</ul>
<p>👉 Different OS → different tools</p>
<hr />
<h3>Step 3: Update vs Upgrade</h3>
<pre><code class="language-plaintext">apt update
</code></pre>
<ul>
<li>Updates the <strong>list of available packages</strong></li>
</ul>
<pre><code class="language-plaintext">apt upgrade
</code></pre>
<ul>
<li>Installs the <strong>latest versions</strong></li>
</ul>
<p>👉 They are NOT the same</p>
<hr />
<h3>What is <code>&amp;&amp;</code> ?</h3>
<p>This is important:</p>
<pre><code class="language-plaintext">sudo apt update &amp;&amp; sudo apt upgrade -y
</code></pre>
<ul>
<li><code>&amp;&amp;</code> means: run next command <strong>only if first succeeds</strong></li>
</ul>
<hr />
<h3>What is <code>-y</code>?</h3>
<p>Automatically says <strong>YES</strong> to prompts</p>
<blockquote>
<p>“Don’t ask me questions, just continue”</p>
</blockquote>
<hr />
<h3>Step 5: Nginx – My First Web Server</h3>
<p>Then I installed Nginx:</p>
<pre><code class="language-plaintext">sudo apt install nginx -y
</code></pre>
<h3>Breaking it down</h3>
<ul>
<li><p><code>install</code> → install software</p>
</li>
<li><p><code>nginx</code> → package name</p>
</li>
<li><p><code>-y</code> → auto confirm</p>
</li>
</ul>
<p>Then I opened my browser:</p>
<pre><code class="language-plaintext">http://&lt;my-ip&gt;
</code></pre>
<p>And then…</p>
<p>I opened my browser…<br />typed my server IP…</p>
<p>and suddenly —</p>
<p>👉 <strong>my website was live.</strong></p>
<p>That was the moment it finally clicked.</p>
<p><strong>BOOM — website is live!</strong></p>
<hr />
<h3>What just happened?</h3>
<p>Nginx is a <strong>web server</strong></p>
<ul>
<li><p>It takes a request</p>
</li>
<li><p>And shows a webpage</p>
</li>
</ul>
<hr />
<h3>Where is the webpage stored?</h3>
<pre><code class="language-plaintext">/var/www/html
</code></pre>
<h3>Breaking path:</h3>
<ul>
<li><p><code>/var</code> → variable data</p>
</li>
<li><p><code>/www</code> → web files</p>
</li>
<li><p><code>/html</code> → website content</p>
</li>
</ul>
<p>This folder = your website content</p>
<hr />
<h3>Moving Ahead → Docker</h3>
<p>Once I understood how a basic web server works,<br />I moved to something more powerful — Docker.</p>
<hr />
<h3>What is Docker?</h3>
<p>Docker lets you run applications in <strong>isolated environments</strong></p>
<p><strong>Analogy:</strong></p>
<ul>
<li><p>Server = building</p>
</li>
<li><p>Container = room</p>
</li>
</ul>
<p>Each room runs its own app independently.</p>
<hr />
<h2>Host vs Container (Big Realization)</h2>
<ul>
<li><p>Host → main server (EC2)</p>
</li>
<li><p>Container → mini environment inside it</p>
</li>
</ul>
<hr />
<h3>Ports Finally Made Sense</h3>
<p>I ran:</p>
<pre><code class="language-plaintext">docker run -d -p 8081:80 --name apache-server httpd
</code></pre>
<p>This was the part that confused me the most at first.</p>
<hr />
<h2>Breaking this command</h2>
<ul>
<li><p><code>docker run</code> → Start a new container</p>
</li>
<li><p><code>-d</code> → run in background</p>
</li>
<li><p><code>-p</code> → port mapping</p>
</li>
<li><p><code>8081:80</code> → connect host port to container port</p>
<ul>
<li><p><code>8081</code> → host port - outside world (your server)</p>
</li>
<li><p><code>80</code> → container port - inside container</p>
</li>
</ul>
</li>
<li><p><code>--name apache-server</code> → name of container</p>
</li>
<li><p><code>httpd</code> → Apache image</p>
</li>
</ul>
<h2>Final Meaning</h2>
<p>👉 Run Apache in a container and expose it on port 8081</p>
<hr />
<h3>How Everything Connects</h3>
<p><strong>Simple idea:</strong><br />Browser hits <strong>8081 → Host forwards → Container 80 → Apache serves</strong></p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/bcbb7f70-3e02-4f03-a7ea-473a110dd725.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>Why is this needed?</h3>
<p>Because:</p>
<ul>
<li><p>Containers are isolated</p>
</li>
<li><p>They need a “door” (port) to communicate</p>
</li>
</ul>
<hr />
<h3>Visual Diagram of AWS EC2 Web Infrastructure</h3>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/53285b71-ca1f-4a76-87a2-9e1af61dbe29.png" alt="" style="display:block;margin:0 auto" />

<table>
<thead>
<tr>
<th>Source</th>
<th>Port</th>
<th>Service</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>Internet</td>
<td>80</td>
<td>Host Nginx</td>
<td>Main entry point and reverse proxy</td>
</tr>
<tr>
<td>Internet</td>
<td>8080</td>
<td>Docker Nginx</td>
<td>Containerized web server</td>
</tr>
<tr>
<td>Internet</td>
<td>8081</td>
<td>Docker Apache</td>
<td>Containerized Apache server</td>
</tr>
</tbody></table>
<hr />
<h3>Problems I Faced (Real Learning)</h3>
<h3>🔸 Nginx didn’t load at first</h3>
<p>I thought something was broken…</p>
<p>But the issue was simple:</p>
<p>👉 Port 80 was closed</p>
<hr />
<h3>🔸 Docker permission denied</h3>
<p>Fixed using:</p>
<pre><code class="language-plaintext">sudo usermod -aG docker ubuntu
newgrp docker
</code></pre>
<hr />
<h3>What this actually means</h3>
<p>👉 “Give docker permission to my user and activate it”</p>
<hr />
<h3>Deep Understanding</h3>
<h3>First command:</h3>
<pre><code class="language-plaintext">sudo usermod -aG docker ubuntu
</code></pre>
<p>Breaking it:</p>
<ul>
<li><p><code>sudo</code> → run as admin</p>
</li>
<li><p><code>usermod</code> → modify user</p>
</li>
<li><p><code>-a</code> → append</p>
</li>
<li><p><code>-G</code> → group</p>
</li>
<li><p><code>-aG</code> → add to group</p>
</li>
<li><p><code>docker</code> → docker group</p>
</li>
<li><p><code>ubuntu</code> → user</p>
</li>
</ul>
<p>👉 Adds user to docker group</p>
<hr />
<h3>Second command:</h3>
<pre><code class="language-plaintext">newgrp docker
</code></pre>
<ul>
<li><p><code>newgrp</code> → switch to new group</p>
</li>
<li><p><code>docker</code> → group name</p>
</li>
</ul>
<p>👉 Applies permission instantly (no logout needed)</p>
<h3>Why needed?</h3>
<p>Without this:<br />permission denied</p>
<p>With this:<br />docker works without sudo</p>
<hr />
<h2>Real Flow</h2>
<pre><code class="language-plaintext">sudo usermod -aG docker ubuntu
newgrp docker
</code></pre>
<p>Result:</p>
<ul>
<li><p>Permission given</p>
</li>
<li><p>Permission activated</p>
</li>
<li><p>Docker works without sudo</p>
</li>
</ul>
<hr />
<h2>Quick Test</h2>
<pre><code class="language-plaintext">docker ps
</code></pre>
<p>If it works → done  </p>
<p>If not → logout/login</p>
<hr />
<h3>🔸 Port already in use</h3>
<p>✔ Fixed → used different ports</p>
<hr />
<h3>🔸 Container name conflict</h3>
<pre><code class="language-plaintext">docker rm apache-server
</code></pre>
<p>👉 Remove old container</p>
<hr />
<h3>Logs (Very Important)</h3>
<p>When things break, logs are your best friend.</p>
<p>I checked:</p>
<pre><code class="language-plaintext">/var/log/nginx/access.log
</code></pre>
<hr />
<h3>What are logs?</h3>
<p>Logs = history of system activity</p>
<p>👉 First place to debug when something breaks</p>
<hr />
<h2>Types</h2>
<table>
<thead>
<tr>
<th>File</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td>access.log</td>
<td>who visited</td>
</tr>
<tr>
<td>error.log</td>
<td>what failed</td>
</tr>
</tbody></table>
<hr />
<h3>Download Logs (scp Explained)</h3>
<pre><code class="language-plaintext">scp -i key.pem ubuntu@IP:~/nginx-logs.txt .
</code></pre>
<p>Let’s break it down:</p>
<ul>
<li><p><code>scp</code> → Secure Copy (copy files between systems)</p>
</li>
<li><p><code>-i</code> → identity file</p>
</li>
<li><p><code>key.pem</code> → private key</p>
</li>
<li><p><code>ubuntu@IP</code> → Remote server</p>
</li>
<li><p><code>:</code> → Separator between server and file path</p>
</li>
<li><p><code>~</code> → home directory</p>
</li>
<li><p><code>nginx-logs.txt</code> → file name</p>
</li>
<li><p><code>.</code> → current folder (your laptop)</p>
</li>
</ul>
<p>👉 Full meaning:</p>
<blockquote>
<p>“Download this file securely from server to my current folder ”</p>
</blockquote>
<hr />
<h3>Final Understanding</h3>
<p>Before today, I was just running commands.</p>
<p>Now, I actually understand what those commands are doing.</p>
<hr />
<h3>After Today</h3>
<p>Now I feel confident that:</p>
<ul>
<li><p>I understand systems</p>
</li>
<li><p>I can connect to servers</p>
</li>
<li><p>I know what ports do</p>
</li>
<li><p>I can debug issues using logs</p>
</li>
</ul>
<hr />
<h3>What I Can Do Now</h3>
<ul>
<li><p>Deploy a cloud server</p>
</li>
<li><p>Run multiple apps</p>
</li>
<li><p>Understand ports</p>
</li>
<li><p>Debug issues using logs</p>
</li>
</ul>
<hr />
<h3>Biggest Realization</h3>
<p>DevOps is NOT about commands.</p>
<p>It’s about understanding:</p>
<p>🔸 How things connect<br />🔸 Why things break<br />🔸 How to fix them</p>
<hr />
<h3>Conclusion</h3>
<p>This was not just a task.</p>
<p>This was my first real step into:</p>
<p>👉 <strong>DevOps thinking</strong></p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham</p>
]]></content:encoded></item><item><title><![CDATA[Day 07 – Scenario-Based Practice]]></title><description><![CDATA[This article is part of my 90 Days of DevOps learning journey.
It continues from my previous post: Linux File System Hierarchy & Scenario-Based Practice
Read previous part here: https://90-days-devops]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-07-scenario-based-practice</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-07-scenario-based-practice</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic]]></category><category><![CDATA[#learninginpublic]]></category><category><![CDATA[DevOps Journey]]></category><category><![CDATA[Linux]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Mon, 13 Apr 2026 17:37:10 GMT</pubDate><content:encoded><![CDATA[<p>This article is part of my 90 Days of DevOps learning journey.</p>
<p>It continues from my previous post: Linux File System Hierarchy &amp; Scenario-Based Practice</p>
<p>Read previous part here: <a href="https://90-days-devops-with-shubham.hashnode.dev/day-07-linux-file-system-hierarchy-scenario-based-practice">https://90-days-devops-with-shubham.hashnode.dev/day-07-linux-file-system-hierarchy-scenario-based-practice</a></p>
<p>In this post, I simulate a real 2 AM production incident and how I debug step by step.</p>
<h3><strong>2 AM Production Issue – How I Debug Step by Step</strong></h3>
<p>It’s 2 AM.</p>
<p>Your server just went down.</p>
<p>Disk is full<br />Service crashed<br />CPU is at 100%</p>
<p>No clear error message.</p>
<p>Just a broken system.</p>
<p><strong>Now what?</strong></p>
<hr />
<h3><strong>How I Think at 2 AM (No Panic, Just Process)</strong></h3>
<p>At 2 AM, I don’t run random commands.</p>
<p>I don’t guess.</p>
<p>I follow a structured approach.</p>
<p>I break the problem into layers —<br /><strong>each step answers ONE question.</strong></p>
<p>I simulate failures and debug step by step like this…</p>
<hr />
<h3><strong>2 AM Debug Flow (Layered Thinking)</strong></h3>
<pre><code class="language-plaintext">Step 1: Can I access server?        → SSH
Step 2: Is service running?         → systemctl status nginx
Step 3: Why did it fail?            → journalctl -u nginx -n 50
Step 4: Is config correct?          → nginx -t
Step 5: Is port open?               → ss -tulnp | grep :80
Step 6: Is system overloaded?       → top
Step 7: Is disk full?               → df -h
Step 8: Any permission issues?      → ls -l
Step 9: Any background jobs?        → crontab -l
Step 10: Dependencies OK?           → systemctl list-dependencies nginx
</code></pre>
<p>✔ Each step = one clear answer<br />✔ No random debugging<br />✔ No wasted time</p>
<hr />
<h3><strong>System Analogy (How I Visualize It)</strong></h3>
<p>I think of the system like a house:</p>
<table>
<thead>
<tr>
<th>System Component</th>
<th>Think Like</th>
</tr>
</thead>
<tbody><tr>
<td>SSH</td>
<td>Main door (entry)</td>
</tr>
<tr>
<td>Nginx</td>
<td>TV (serves website)</td>
</tr>
<tr>
<td>Cron</td>
<td>Alarm clock</td>
</tr>
<tr>
<td>CPU</td>
<td>Electricity load</td>
</tr>
<tr>
<td>Disk</td>
<td>Storage room</td>
</tr>
<tr>
<td>Ports</td>
<td>Cable connections</td>
</tr>
<tr>
<td>Logs</td>
<td>CCTV footage</td>
</tr>
<tr>
<td>systemd</td>
<td>Power control system</td>
</tr>
</tbody></table>
<p>This helps me debug faster without confusion.</p>
<hr />
<h3><strong>Universal Troubleshooting Flow (Golden Rule)</strong></h3>
<p>Whenever something breaks, I follow this order:</p>
<pre><code class="language-plaintext">systemctl status nginx
</code></pre>
<p>Check current state (running/failed)</p>
<pre><code class="language-plaintext">journalctl -u nginx -n 50
</code></pre>
<p>Find <strong>why</strong> it failed</p>
<pre><code class="language-plaintext">systemctl is-enabled nginx
</code></pre>
<p>Check if it starts after reboot</p>
<pre><code class="language-plaintext">systemctl list-dependencies nginx
</code></pre>
<p>Verify required services</p>
<pre><code class="language-plaintext">systemctl restart nginx
</code></pre>
<p>Apply fix and validate</p>
<hr />
<h3><strong>Meaning</strong></h3>
<ul>
<li><p><strong>status →</strong> What’s happening</p>
</li>
<li><p><strong>logs →</strong> Why it failed</p>
</li>
<li><p><strong>enable →</strong> Startup behavior</p>
</li>
<li><p><strong>dependencies →</strong> What it depends on</p>
</li>
<li><p><strong>restart →</strong> Apply fix</p>
</li>
</ul>
<hr />
<h3><strong>Practice Mindset (How I Learned This)</strong></h3>
<p>To truly understand this, I didn’t just read.</p>
<p>I simulated failure:</p>
<pre><code class="language-plaintext">sudo systemctl stop nginx
</code></pre>
<p>This helped me practice <strong>real debugging safely</strong></p>
<hr />
<h2><strong>Real Scenario Walkthrough (Disk Full Issue)</strong></h2>
<p>Let’s walk through a real situation.</p>
<h3>Issue: Website is down</h3>
<hr />
<h3>Case 1: Disk Full Issue</h3>
<p>Step 1: Verify disk usage</p>
<pre><code class="language-plaintext">df -h
</code></pre>
<p>🔹 Found: <code>/var</code> is <strong>100% full</strong></p>
<hr />
<p>Step 2: Find what’s taking space</p>
<pre><code class="language-plaintext">du -sh /var/log/* 2&gt;/dev/null | sort -h | tail -5
</code></pre>
<p>🔹 Found: Large log files inside <code>/var/log</code></p>
<hr />
<p>Step 3: Fix safely</p>
<pre><code class="language-plaintext">sudo truncate -s 0 /var/log/syslog
</code></pre>
<p>🔹Clears log without deleting file</p>
<hr />
<p>Step 4: Restart service</p>
<pre><code class="language-plaintext">sudo systemctl restart nginx
</code></pre>
<hr />
<p>Step 5: Verify</p>
<pre><code class="language-plaintext">systemctl status nginx
</code></pre>
<p>🔹Service is <strong>running again</strong></p>
<hr />
<h3>🔶 <strong>Result</strong></h3>
<ul>
<li><p>Disk space freed</p>
</li>
<li><p>Service restored</p>
</li>
<li><p>Website accessible</p>
</li>
</ul>
<p><strong>Issue resolved</strong></p>
<hr />
<p>Let’s look at another common production issue.</p>
<h3>Case <strong>2: High CPU Usage</strong></h3>
<p>When CPU is high:</p>
<pre><code class="language-plaintext">top
</code></pre>
<p>🔹Check overall usage</p>
<pre><code class="language-plaintext">htop
</code></pre>
<p>🔹Better visualization</p>
<pre><code class="language-plaintext">ps aux --sort=-%cpu | head -10
</code></pre>
<p>🔹Find top processes</p>
<pre><code class="language-plaintext">pidstat -p 1
</code></pre>
<p>🔹Monitor process</p>
<pre><code class="language-plaintext">kill &lt;pid&gt;
</code></pre>
<p>🔹Stop process</p>
<pre><code class="language-plaintext">kill -9 &lt;pid&gt;
</code></pre>
<p>🔹Force kill (last option)</p>
<hr />
<h3><strong>Real Mapping</strong></h3>
<ul>
<li><p>nginx → Too many requests</p>
</li>
<li><p>cron → Bad script loop</p>
</li>
<li><p>ssh → Possible attack</p>
</li>
</ul>
<hr />
<p>Now let’s focus on logs — the most critical debugging tool.</p>
<h3>Case <strong>3: Logs (Most Important Tool)</strong></h3>
<p>Logs tell the <strong>real story</strong>.</p>
<pre><code class="language-plaintext">journalctl -u nginx -n 50
</code></pre>
<p>🔹Recent errors</p>
<pre><code class="language-plaintext">journalctl -u nginx -f
</code></pre>
<p>🔹Live logs</p>
<pre><code class="language-plaintext">journalctl -u nginx --since "10 minutes ago"
</code></pre>
<p>🔹Time-based filtering</p>
<hr />
<h3>Service Logs</h3>
<p>🔸<strong>SSH</strong></p>
<pre><code class="language-plaintext">journalctl -u ssh -n 20
</code></pre>
<p>🔸<strong>Nginx</strong></p>
<pre><code class="language-plaintext">tail -f /var/log/nginx/error.log
tail -f /var/log/nginx/access.log
</code></pre>
<p>🔹Logs = <strong>best debugging tool</strong></p>
<hr />
<p>Sometimes the issue is not the service, but access itself.</p>
<h3>Case <strong>4: Permission Issues</strong></h3>
<pre><code class="language-plaintext">ls -l file
</code></pre>
<p>🔹Check permissions</p>
<pre><code class="language-plaintext">chmod +x file
</code></pre>
<p>🔹Add execute permission</p>
<pre><code class="language-plaintext">./file
</code></pre>
<p>🔹Run script</p>
<hr />
<h3>Common Mistakes</h3>
<ul>
<li><p>Running a directory</p>
</li>
<li><p>File doesn’t exist</p>
</li>
<li><p>Missing execute permission</p>
</li>
</ul>
<hr />
<p>Let’s go one level deeper into disk usage analysis.</p>
<h3>Case <strong>5: Disk Debugging Deep Dive</strong></h3>
<pre><code class="language-plaintext">du -sh /* 2&gt;/dev/null | sort -h
</code></pre>
<p>🔹Find large directories</p>
<pre><code class="language-plaintext">du -sh /var/* 2&gt;/dev/null | sort -h
</code></pre>
<p>🔹Drill into <code>/var</code></p>
<h3>Command Breakdown</h3>
<ul>
<li><p><code>du</code> → Disk usage</p>
</li>
<li><p><code>-s</code> → Summary</p>
</li>
<li><p><code>-h</code> → Human readable</p>
</li>
<li><p><code>sort -h</code> → Sort by size</p>
</li>
<li><p><code>tail -5</code> → Largest files</p>
</li>
</ul>
<hr />
<p>In some cases, the service is running but still not reachable.</p>
<h3>Case <strong>6: Service Running but Not Accessible</strong></h3>
<pre><code class="language-plaintext">curl localhost
</code></pre>
<p>🔹Check response</p>
<pre><code class="language-plaintext">ss -tulnp
</code></pre>
<p>🔹Open ports</p>
<pre><code class="language-plaintext">ss -tulnp | grep :80
</code></pre>
<p>🔹Check port 80</p>
<h3>Example Output:</h3>
<pre><code class="language-plaintext">tcp LISTEN 0 511 0.0.0.0:80
</code></pre>
<p>🔹Service is listening and ready</p>
<hr />
<p>If you can’t even access the server, debugging starts with SSH.</p>
<h3>Case <strong>7: SSH Debugging</strong></h3>
<pre><code class="language-plaintext">systemctl status ssh
ss -tulnp | grep :22
journalctl -u ssh -n 20
</code></pre>
<hr />
<p>Background jobs can also silently break systems.</p>
<h3>Case <strong>8: Cron Debugging</strong></h3>
<pre><code class="language-plaintext">systemctl status cron
journalctl -u cron
crontab -l
crontab -e
</code></pre>
<p>🔹Example:</p>
<pre><code class="language-plaintext">echo "hello" &gt;&gt; /tmp/test.log
</code></pre>
<hr />
<p>Sometimes the issue is not the service itself, but what it depends on.</p>
<h3>Case <strong>9: Dependencies Check</strong></h3>
<pre><code class="language-plaintext">systemctl list-dependencies nginx
</code></pre>
<p>🔹Example: <a href="http://network-online.target"><code>network-online.target</code></a> must be ready</p>
<hr />
<h3><strong>Final Execution Order (Production Ready Flow)</strong></h3>
<pre><code class="language-plaintext">systemctl status ssh
systemctl status nginx
journalctl -u nginx -n 50
nginx -t
ss -tulnp | grep :80
curl localhost
top
df -h
du -sh /*
ls -l
crontab -l
systemctl list-dependencies nginx
systemctl restart nginx
systemctl status nginx
</code></pre>
<hr />
<h3><strong>What I Learned</strong></h3>
<ul>
<li><p>Simulated real failures (nginx stop)</p>
</li>
<li><p>Understood logs deeply</p>
</li>
<li><p>Practiced disk troubleshooting</p>
</li>
<li><p>Connected Linux directories to real issues</p>
</li>
</ul>
<hr />
<h3><strong>Final Thought</strong></h3>
<p>At 2 AM, production issues are not about knowing more commands.</p>
<p>They are about:</p>
<ul>
<li><p>Staying calm</p>
</li>
<li><p>Thinking in layers</p>
</li>
<li><p>Asking the right questions</p>
</li>
</ul>
<p>Because in production, you don’t fix systems by guessing.</p>
<p>You fix them by asking the right questions.</p>
<p>And every command should answer one.</p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic</p>
]]></content:encoded></item><item><title><![CDATA[Day 07 – Linux File System Hierarchy & Scenario-Based Practice]]></title><description><![CDATA[Your server is running fine… until suddenly:
Disk is fullNginx stopped respondingCPU is at 100%
Now users can’t access your website.
No clear error message.
Just a broken system.
Where do you even sta]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-07-linux-file-system-hierarchy-scenario-based-practice</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-07-linux-file-system-hierarchy-scenario-based-practice</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic]]></category><category><![CDATA[#learninginpublic]]></category><category><![CDATA[DevOps Journey]]></category><category><![CDATA[Linux]]></category><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Mon, 13 Apr 2026 11:49:58 GMT</pubDate><content:encoded><![CDATA[<p><strong>Your server is running fine… until suddenly:</strong></p>
<p>Disk is full<br />Nginx stopped responding<br />CPU is at 100%</p>
<p>Now users can’t access your website.</p>
<p>No clear error message.</p>
<p>Just a broken system.</p>
<p>Where do you even start?</p>
<p>Logs don’t fail loudly — they fill silently.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/5aa90ff2-83bd-48b0-b508-83c40b154439.png" alt="" style="display:block;margin:0 auto" />

<p>This is exactly the situation I wanted to understand while learning DevOps.</p>
<hr />
<h2>Part 1: Linux File System Hierarchy (What I Actually Use in Debugging)</h2>
<h3>🔹 Core Directories</h3>
<table>
<thead>
<tr>
<th>Directory</th>
<th>Contains / Purpose</th>
<th>Example</th>
<th>I would use this when...</th>
</tr>
</thead>
<tbody><tr>
<td><code>/</code></td>
<td>The root of everything. Every file and directory starts here. <code>ls -l /</code></td>
<td><code>bin, etc, home, var</code></td>
<td>When navigating or debugging system-wide issues, everything traces back to root.</td>
</tr>
<tr>
<td><code>/root</code></td>
<td>Root user’s home directory <code>ls -la /root</code> , <code>ls -la ~</code></td>
<td><code>.bashrc, .ssh</code></td>
<td>Performing admin-level tasks</td>
</tr>
<tr>
<td><code>/tmp</code></td>
<td>Temporary files (cleared on reboot) <code>ls -l /tmp</code></td>
<td><code>temp files</code></td>
<td>Testing or temporary storage</td>
</tr>
<tr>
<td><code>/bin</code></td>
<td>Essential system binaries</td>
<td><code>ls, cp, mv, bash</code></td>
<td>Running basic Linux commands</td>
</tr>
<tr>
<td><code>/usr/bin</code></td>
<td>User-level binaries</td>
<td><code>python3, git, vim</code></td>
<td>Using installed applications</td>
</tr>
<tr>
<td><code>/opt</code></td>
<td>Third-party applications</td>
<td><code>custom apps</code></td>
<td>Managing external software</td>
</tr>
</tbody></table>
<h3>How I Actually Use This in Troubleshooting</h3>
<p>Don’t memorize directories — Map them to problems:</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/a5aeb23f-047e-4fe6-9ae6-2ac273c0507c.png" alt="" style="display:block;margin:0 auto" />

<p>This approach helps me move faster instead of guessing.</p>
<hr />
<h3>Rule:</h3>
<p>Check the right folder fixes the problem fast</p>
<h3><code>/etc</code> → Configuration (VERY IMPORTANT)</h3>
<p>Contains configuration files for services.</p>
<pre><code class="language-plaintext">ls -l /etc
</code></pre>
<p><strong>When I use this:</strong></p>
<ul>
<li><p>If a service breaks after a config change</p>
</li>
<li><p>If nginx, ssh, passwd, hostname or any service is misbehaving</p>
</li>
</ul>
<p>Example:</p>
<ul>
<li><p>If nginx fails, I immediately check configs inside:</p>
<pre><code class="language-plaintext">cd /etc/nginx
</code></pre>
</li>
</ul>
<hr />
<h3><code>/var</code> → Variable Data (Logs, Cache, Runtime)</h3>
<p>I check this when disk usage suddenly increases</p>
<p>WHY?</p>
<p>Because logs, cache, and runtime data keep growing here.</p>
<p>Most real-world disk issues originate from <code>/var</code>.</p>
<hr />
<h3><code>/var/log</code> → Debugging Heart</h3>
<p>This is where most troubleshooting begins.</p>
<pre><code class="language-plaintext">ls -l /var/log
</code></pre>
<p><strong>When I use this:</strong></p>
<ul>
<li><p>Application crashes</p>
</li>
<li><p>Service failures</p>
</li>
<li><p>System errors</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="language-plaintext">cd /var/log
ls
tail -f syslog
tail -f auth.log
</code></pre>
<hr />
<h3><code>/home</code> → User Data</h3>
<p>Contains user-specific files and scripts.</p>
<pre><code class="language-plaintext">ls -la /home
</code></pre>
<p><strong>When I use this:</strong></p>
<ul>
<li><p>Debugging user files and scripts</p>
</li>
<li><p>Checking permissions</p>
</li>
</ul>
<p>Example:</p>
<ul>
<li><strong>/home/ubuntu</strong></li>
</ul>
<hr />
<h3><code>/proc</code> &amp; <code>/sys</code> → System Information</h3>
<ul>
<li><p><code>/proc</code> → Process/system info (virtual)</p>
</li>
<li><p><code>/sys</code> → Kernel &amp; hardware info</p>
</li>
</ul>
<p><strong>When I use this:</strong></p>
<ul>
<li>CPU, memory, process-level debugging</li>
</ul>
<hr />
<h2>🔹 Additional Important Directories</h2>
<ul>
<li><p><code>/sbin</code> → System/admin commands (reboot, fsck)</p>
</li>
<li><p><code>/usr</code> → Installed software &amp; libraries</p>
</li>
<li><p><code>/boot</code> → Bootloader &amp; kernel files</p>
</li>
<li><p><code>/dev</code> → Device files (disk, USB)</p>
</li>
<li><p><code>/mnt</code> → Temporary mounts</p>
</li>
<li><p><code>/media</code> → USB/CD mounts</p>
</li>
</ul>
<hr />
<h2>Commands I Practiced</h2>
<pre><code class="language-plaintext">1. Find Large Log Files

du -sh /var/log/* 2&gt;/dev/null | sort -h | tail -5 
# Use this to identify logs consuming disk space

2. Check Configuration

cat /etc/hostname 
# Helps understand system-level config

3. Explore Home Directory

ls -la ~
# Used to inspect user configs like .bashrc
</code></pre>
<hr />
<h2>Part 2: DevOps Troubleshooting Mindset</h2>
<h3>Rule</h3>
<p><strong>Problem → Check → Logs → Fix → Verify</strong></p>
<p>If you're in a <strong>production issue</strong>, always check in this order:</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b3177fa2-3087-4644-ac2e-6ef68d446cb2.png" alt="" style="display:block;margin:0 auto" />

<p>When something breaks, think like this:</p>
<table>
<thead>
<tr>
<th>Problem Type</th>
<th>Check Folder</th>
<th>Why Check Here</th>
</tr>
</thead>
<tbody><tr>
<td>Service fails/Config issue?</td>
<td><strong>/etc ⭐</strong></td>
<td>check configuration files</td>
</tr>
<tr>
<td>Error / Crash?</td>
<td><strong>/var/log ⭐</strong></td>
<td>logs are your best friend</td>
</tr>
<tr>
<td>Disk full?</td>
<td><strong>/var</strong></td>
<td>logs, cache, temp data grow here</td>
</tr>
<tr>
<td>Script issue?</td>
<td><strong>/home</strong></td>
<td>user scripts, cron jobs</td>
</tr>
<tr>
<td>System issue?</td>
<td><strong>/proc, /sys</strong></td>
<td>CPU, memory, kernel info</td>
</tr>
</tbody></table>
<p>This removes guesswork and speeds up debugging.</p>
<hr />
<h3>Powerful Concept</h3>
<p><strong>Service running ≠ Accessible</strong></p>
<p>A running service doesn’t mean a working service.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/341ed931-2ad4-4bd7-b4c4-06a5d717db1f.png" alt="" style="display:block;margin:0 auto" />

<p>Even if service is running:</p>
<ul>
<li><p>Port may be closed</p>
</li>
<li><p>Service may be stuck</p>
</li>
<li><p>Network may be blocked</p>
</li>
</ul>
<hr />
<h2><strong>Simulated Incident: Disk Full Due to Logs</strong></h2>
<p>The server was running fine… until I intentionally created a failure scenario.</p>
<p>I stopped nginx to simulate service failure, and separately explored how logs grow inside /var/log</p>
<p>Soon, things started breaking — services behaving unexpectedly, system slowing down.</p>
<pre><code class="language-plaintext">systemctl status nginx
journalctl -u nginx
</code></pre>
<p><strong>Observation:</strong></p>
<ul>
<li><p>Confirmed service instability</p>
</li>
<li><p>Errors visible in logs</p>
</li>
</ul>
<hr />
<p><strong>My first instinct was to check system health.</strong></p>
<p>So I ran:</p>
<pre><code class="language-plaintext">df -h

Filesystem   Size  Used Avail Use%
/dev/sda1     20G   20G     0G 100%
</code></pre>
<p>Disk issues don’t crash systems — they slowly degrade everything.</p>
<p>→ I immediately noticed something unusual.  </p>
<p>The <strong>/var partition was at 100%</strong>.</p>
<p>Now I had a clear direction —  </p>
<p>this wasn’t a CPU or memory issue, it was a <strong>disk space problem</strong>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/da3c2d0a-9b25-4d24-9939-d8a2f45d793a.png" alt="" style="display:block;margin:0 auto" />

<hr />
<p><strong>Next step: Identify what’s consuming space inside /var</strong></p>
<p>I moved into the directory:</p>
<pre><code class="language-plaintext">cd /var
</code></pre>
<p>To dig deeper, I ran:</p>
<pre><code class="language-plaintext">du -sh * | sort -hr
</code></pre>
<p>→ One directory stood out — <strong>/var/log</strong> was consuming most of the space.</p>
<p>That was my next checkpoint.</p>
<hr />
<p><strong>Drilling down into logs</strong></p>
<pre><code class="language-plaintext">cd /var/log
du -sh * | sort -hr
</code></pre>
<p>→ I found large log files related to <strong>nginx</strong>.</p>
<p>At this point, things connected:</p>
<ul>
<li><p>Logs were growing continuously</p>
</li>
<li><p>Disk got filled</p>
</li>
<li><p>Services started failing</p>
</li>
</ul>
<hr />
<h3><strong>Root Cause Identified</strong></h3>
<p>Now that the root cause was clear, I proceeded to free up disk space.</p>
<p>The issue was clear now:</p>
<p><strong>nginx logs had grown uncontrollably and filled the /var partition.</strong></p>
<p>Most outages aren’t sudden — they are silent buildup over time.</p>
<hr />
<h3>Fix Applied</h3>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/71db5cb8-59a9-4bf1-949a-b936f5be54f2.png" alt="" style="display:block;margin:0 auto" />

<p>Avoid this risky command in real environments:</p>
<pre><code class="language-plaintext">rm -f *.log
</code></pre>
<p>Replace with:</p>
<pre><code class="language-plaintext"># Clear logs safely
truncate -s 0 /var/log/nginx/access.log
truncate -s 0 /var/log/nginx/error.log
</code></pre>
<p>Fixing is easy — fixing safely is what matters in production.</p>
<p>Add note:</p>
<blockquote>
<p>Avoid deleting logs blindly in production systems</p>
</blockquote>
<p>This is a very common real-world scenario where:</p>
<ul>
<li><p>Log rotation is missing or misconfigured</p>
</li>
<li><p>Debug logs are left ON</p>
</li>
<li><p>High traffic generates huge logs</p>
</li>
<li><p>Disk space was freed, and system behavior returned to normal.</p>
</li>
</ul>
<hr />
<h3>Service Recovery Check</h3>
<p>After fixing, add:</p>
<pre><code class="language-plaintext">systemctl restart nginx
systemctl status nginx
</code></pre>
<p>Once disk space was restored, services stabilized and normal operations resumed.</p>
<hr />
<h3>Prevention Step:</h3>
<p>To avoid this in future:</p>
<ul>
<li><p>Configure log rotation</p>
</li>
<li><p>Monitor disk usage regularly</p>
</li>
</ul>
<pre><code class="language-plaintext">logrotate -f /etc/logrotate.conf
</code></pre>
<ul>
<li>Log rotation prevents future disk issues</li>
</ul>
<hr />
<h3>Real Impact</h3>
<p>Because disk was full:</p>
<ul>
<li><p>Logs could not be written</p>
</li>
<li><p>Services became unstable</p>
</li>
<li><p>System performance degraded</p>
</li>
</ul>
<hr />
<h3>Quick Debug Checklist</h3>
<pre><code class="language-plaintext"># 1. Check disk
df -h

# 2. Find large directories
du -sh /* | sort -hr | head

# 3. Check logs
cd /var/log
du -sh * | sort -hr

# 4. Check service
systemctl status nginx

# 5. Clear logs safely
truncate -s 0 &lt;logfile&gt;

# 6. Restart service
systemctl restart nginx
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/5eb7e8ef-39f9-4bb0-9f63-bb62cc1b3d41.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3><strong>What I learned from this</strong></h3>
<p>Disk issues are silent killers — they don’t crash immediately, they slowly degrade everything.</p>
<p>This wasn’t just about commands — it was about <strong>thinking directionally</strong>:</p>
<ul>
<li><p>I didn’t randomly check everything</p>
</li>
<li><p>I followed a <strong>signal → investigation → root cause path</strong></p>
</li>
</ul>
<p>Disk issue → Check <code>/var</code> → Inspect <code>/var/log</code> → Identify service logs</p>
<hr />
<p>In real DevOps, problems don’t come labeled.</p>
<p>You don’t get: “Disk is full → Fix here”</p>
<p>You get:</p>
<p>System is slow<br />Service is down<br />No clear error</p>
<p>And you have to figure it out.</p>
<p>This exercise helped me move from:<br />Running commands blindly</p>
<p>To:<br />Thinking in systems</p>
<p>Because DevOps is not about:<br />Knowing more commands</p>
<p>It’s about:<br />Knowing where to look first.<br />What to check first<br />How to think during failures</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/10137557-7e2d-47ec-9b20-ff11c7e23dfd.png" alt="" style="display:block;margin:0 auto" />

<hr />
<p>Next Part: I simulated a real 2 AM production incident and how I debug step by step. Read : <a href="https://90-days-devops-with-shubham.hashnode.dev/day-07-scenario-based-practice">https://90-days-devops-with-shubham.hashnode.dev/day-07-scenario-based-practice</a></p>
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic</p>
]]></content:encoded></item><item><title><![CDATA[Day 05 – My First Real Linux Troubleshooting Drill

]]></title><description><![CDATA[It’s a typical production scenario.
Instead of just running commands, I tried to think like someone handling a real production issue.

The Situation
Imagine this:

A user says: “The website is not wor]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-05-my-first-real-linux-troubleshooting-drill</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-05-my-first-real-linux-troubleshooting-drill</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham  Happy Learning]]></category><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sat, 11 Apr 2026 18:18:13 GMT</pubDate><content:encoded><![CDATA[<p>It’s a typical production scenario.</p>
<p>Instead of just running commands, I tried to <strong>think like someone handling a real production issue</strong>.</p>
<hr />
<h2>The Situation</h2>
<p>Imagine this:</p>
<blockquote>
<p>A user says: <em>“The website is not working properly.”</em></p>
</blockquote>
<p>No logs.<br />No clear error.<br />No context.</p>
<p>Just that something feels off.</p>
<p>That’s exactly how real incidents start.</p>
<p>To simulate this real-world situation, I performed a troubleshooting drill on the <strong>nginx (web server) service</strong>.</p>
<hr />
<h2>Step 1: Understand the System</h2>
<p>I started with Basic environment checks:</p>
<pre><code class="language-shell">uname -a
lsb_release -a
</code></pre>
<p>Just to confirm:</p>
<ul>
<li><p>What OS I’m on</p>
</li>
<li><p>What environment I’m dealing with</p>
</li>
</ul>
<p><strong>Observation:</strong></p>
<ul>
<li><p>Ubuntu system running on x86_64 architecture</p>
</li>
<li><p>Stable and supported environment</p>
</li>
</ul>
<p><strong>Insight:</strong> Always know your system before debugging.</p>
<hr />
<h2>Step 2: Check Filesystem Sanity</h2>
<p>I tested if the system is writable:</p>
<pre><code class="language-plaintext">mkdir /tmp/runbook-demo
cp /etc/hosts /tmp/runbook-demo/hosts-copy
ls -l /tmp/runbook-demo
</code></pre>
<ul>
<li><p>Created a temp folder</p>
</li>
<li><p>Copied a file</p>
</li>
</ul>
<p><strong>Observation:</strong></p>
<ul>
<li><p>Filesystem is writable</p>
</li>
<li><p>File operations working correctly</p>
</li>
<li><p>Everything worked fine → disk is healthy</p>
</li>
</ul>
<hr />
<h2>Step 3: CPU &amp; Memory Check</h2>
<p>Commands used:</p>
<pre><code class="language-shell">top
free -h

Why?
To check if high CPU or memory usage is causing the issue.

If system resources are exhausted, services may become
slow or unresponsive.
</code></pre>
<p>Observation:</p>
<ul>
<li><p>No CPU spikes</p>
</li>
<li><p>Memory usage normal</p>
</li>
<li><p>No swap usage</p>
</li>
</ul>
<p><strong>Insight:</strong> If system resources are fine, problem is likely elsewhere</p>
<hr />
<h2>Step 4: Disk &amp; Logs(IO) Size</h2>
<pre><code class="language-css">df -h → disk usage ~40%
du -sh /var/log → logs are normal
</code></pre>
<p><strong>Observation:</strong></p>
<ul>
<li><p>Disk usage around ~40%</p>
</li>
<li><p>Log size is within normal limits</p>
</li>
<li><p>No disk pressure → good sign</p>
</li>
</ul>
<hr />
<h2>Step 5: Network Check</h2>
<pre><code class="language-css">ss -tulpn | grep nginx
curl -I http://localhost
</code></pre>
<p><strong>Observation:</strong></p>
<ul>
<li><p>Nginx listening on port 80</p>
</li>
<li><p>HTTP 200 OK response - Service is reachable and responding correctly</p>
</li>
</ul>
<hr />
<h2>Step 6: Logs Analysis (Most Important)</h2>
<pre><code class="language-shell">journalctl -u nginx -n 50
tail -n 50 /var/log/nginx/error.log
</code></pre>
<p><strong>Observation:</strong></p>
<p>I saw this:</p>
<pre><code class="language-plaintext">[notice] using inherited sockets
</code></pre>
<p>At first I thought: “Is this an error?”</p>
<p>But then I learned:</p>
<ul>
<li><p>info / notice → Normal system behavior</p>
</li>
<li><p>It’s just normal behavior during restart/reload</p>
</li>
</ul>
<hr />
<h2>Biggest Learning</h2>
<p>Not every log is a problem.</p>
<p>This was a big mindset shift:</p>
<ul>
<li><p>Don’t panic when you see logs</p>
</li>
<li><p>Read the log level (<code>info</code>, <code>notice</code>, <code>warn</code>, <code>error</code>)</p>
<ul>
<li><p>Log levels matter:</p>
<ul>
<li><p><code>info</code> / <code>notice</code> → normal behavior</p>
</li>
<li><p><code>warn</code> / <code>error</code> → requires attention</p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/64c21320-13ad-4e09-b075-061b7ab92099.png" alt="" style="display:block;margin:0 auto" />

<p>This helped me avoid a common beginner mistake:<br />Assuming every log entry is an error.</p>
<hr />
<h2>What if it was actually broken?</h2>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b61a52ca-d809-4f95-98b8-94747e02e1f7.png" alt="" style="display:block;margin:0 auto" />

<p>If nginx actually failed:</p>
<ul>
<li><p>Restart the service</p>
<pre><code class="language-plaintext">sudo systemctl restart nginx
</code></pre>
</li>
<li><p>Check logs again (more lines, live logs)</p>
<pre><code class="language-shell">journalctl -u nginx -n 100
tail -f /var/log/nginx/error.log
</code></pre>
</li>
<li><p>Deep debugging</p>
<ul>
<li><p>Increase log level to debug<br />OR</p>
</li>
<li><p>use <code>strace -p &lt;pid&gt;</code> if logs are not enough</p>
</li>
</ul>
</li>
</ul>
<p>This drill prepares me to handle such real failures.</p>
<hr />
<p>This exercise helped me understand real DevOps challenges:</p>
<p>• Problems are often unclear<br />• Logs can be messy and overwhelming<br />• Time is always limited</p>
<p>Having a repeatable checklist helps to:</p>
<p>• Stay calm under pressure<br />• Avoid guessing<br />• Fix issues faster<br />• Build a structured troubleshooting approach<br />• Understand system signals (CPU, memory, disk, network)<br />• Develop a log-first mindset</p>
<hr />
<p>Today, I didn’t just run Linux commands.</p>
<p>I learned how to:<br />• Break down vague problems<br />• Validate assumptions step-by-step<br />• Read system signals instead of guessing</p>
<hr />
<h3>Quick Troubleshooting Flow:</h3>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/5150ae42-977e-4cb9-9ce3-c62b47037afa.png" alt="" style="display:block;margin:0 auto" />

<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic</p>
]]></content:encoded></item><item><title><![CDATA[Day 04 – Linux Practice: Processes, Services & Logs ]]></title><description><![CDATA[Your server is down. Users can't log in.Is it the process? The service? Or something hidden in the logs?
This is where real troubleshooting begins.
If you're starting your Linux/DevOps journey, unders]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-04-linux-practice-processes-services-logs</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-04-linux-practice-processes-services-logs</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic]]></category><category><![CDATA[#learninginpublic]]></category><category><![CDATA[DevOps Journey]]></category><category><![CDATA[Linux]]></category><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sat, 11 Apr 2026 17:32:22 GMT</pubDate><content:encoded><![CDATA[<p><strong>Your server is down. Users can't log in.</strong><br />Is it the process? The service? Or something hidden in the logs?</p>
<p>This is where real troubleshooting begins.</p>
<p>If you're starting your Linux/DevOps journey, understanding processes, services, and logs is one of the most important skills. In this practice session, I explored how to monitor system activity, inspect services like SSH, and troubleshoot issues in a structured way.</p>
<hr />
<h3>🔹 What are Processes, Services, and Logs?</h3>
<p>Before jumping into commands, here’s a simple way to understand:</p>
<ul>
<li><p><strong>Processes</strong> → What is currently running</p>
</li>
<li><p><strong>Services</strong> → What should be running (managed by system)</p>
</li>
<li><p><strong>Logs</strong> → What actually happened (history + errors)</p>
</li>
</ul>
<hr />
<h3>🔹 Process Checks</h3>
<p>Processes tell us what programs are actively running on the system.</p>
<h3>List running processes</h3>
<pre><code class="language-bash">ps aux | head
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/bc3df311-f9da-4f48-8b1c-7fa6ec602419.png" alt="" style="display:block;margin:0 auto" />

<p>This shows a snapshot of active processes with CPU and memory usage.</p>
<hr />
<h3>Find a specific process</h3>
<pre><code class="language-bash">pgrep ssh
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/7176fdd5-aa23-4716-b65a-35a265654649.png" alt="" style="display:block;margin:0 auto" />

<p>This helps locate the process ID (PID) of SSH.</p>
<hr />
<h3>Detailed SSH process check</h3>
<pre><code class="language-bash">pgrep -a sshd
ps aux | grep sshd
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/a618c9fe-9ed1-4c76-baf5-dff1f83fcf44.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/8d131870-24fd-4605-9c08-7bc9c4be096d.png" alt="" style="display:block;margin:0 auto" />

<p>Shows all SSH-related processes, including active sessions.</p>
<hr />
<h3>Check current shell process</h3>
<pre><code class="language-bash">ps -p $$
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/50737748-af1f-496a-be0a-93b335cd99a1.png" alt="" style="display:block;margin:0 auto" />

<p>Displays details of your current terminal session.</p>
<hr />
<h3>Real-time monitoring</h3>
<pre><code class="language-bash">top
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/e7d7779b-7fb4-4609-ac98-67e548a6ea58.png" alt="" style="display:block;margin:0 auto" />

<p>Useful for live CPU/memory tracking.</p>
<hr />
<h2>🔹 Service Checks (SSH Example)</h2>
<p>Services are long-running background programs like SSH, Docker, or Nginx.</p>
<hr />
<h3>Check SSH service status</h3>
<pre><code class="language-bash">systemctl status ssh
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/703bf489-1f77-4813-acb7-fe1621a06123.png" alt="" style="display:block;margin:0 auto" />

<p>If you see <code>active (running)</code> → everything is fine.</p>
<hr />
<h3>List running services</h3>
<pre><code class="language-bash">systemctl list-units --type=service --state=running
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/5b716802-016e-4016-a8b2-9e983323be85.png" alt="" style="display:block;margin:0 auto" />

<p>Shows all currently active services on your system.</p>
<hr />
<h3>Check if service is enabled</h3>
<pre><code class="language-bash">systemctl is-enabled ssh
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/d6faa74a-2d32-45f8-b3ed-85bde507ce47.png" alt="" style="display:block;margin:0 auto" />

<p>Tells whether SSH starts automatically at boot.</p>
<hr />
<h2>🔹 Log Checks</h2>
<p>Logs are the <strong>most important part of troubleshooting</strong>.</p>
<hr />
<h3>Check SSH logs</h3>
<pre><code class="language-bash">journalctl -u ssh --no-pager | tail -n 5
</code></pre>
<hr />
<h3>Check system logs</h3>
<pre><code class="language-bash">tail -n 20 /var/log/syslog
</code></pre>
<hr />
<h3>Check authentication logs</h3>
<pre><code class="language-bash">tail -n 10 /var/log/auth.log
</code></pre>
<p>This file is very important because it shows:</p>
<ul>
<li><p>Login attempts</p>
</li>
<li><p>Failed SSH connections</p>
</li>
<li><p>Security-related events</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="language-plaintext">Connection reset by 111.x.x.x [preauth]
</code></pre>
<p>This usually means bots are trying to connect to your server — <strong>this is normal on public servers (e.g., AWS EC2 instances).</strong></p>
<hr />
<h1>🔹 SSH Service Inspection</h1>
<p>Service inspection means verifying everything about a service:</p>
<ul>
<li><p>Is it running? → <code>systemctl status ssh</code></p>
</li>
<li><p>Is process active? → <code>pgrep ssh</code></p>
</li>
<li><p>Are logs clean? → <code>journalctl -u ssh</code></p>
</li>
<li><p>Is port open? → <code>ss -tuln | grep :22</code></p>
</li>
</ul>
<p>If all checks pass, the service is considered healthy.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/1a35c1a5-9051-4e0c-aca7-50a84adfc6f4.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>🔹 Troubleshooting Flow (Real Skill)</h2>
<h3>Scenario: SSH not working</h3>
<p>Run these checks step by step:</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/0a502891-3409-483c-a3ae-05c45e1a4470.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Note:</strong> Use <code>systemctl restart ssh</code> carefully in production, as it may disconnect your active session.</p>
<hr />
<p><strong>How do you troubleshoot a service?</strong></p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/9ce52e7d-a9a2-4f2c-b807-980c191409fa.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h2>🔹 Real-World Practice: Nginx (Web Server)</h2>
<p>To simulate a real issue, I practiced with a web server.</p>
<hr />
<h3>Install Nginx</h3>
<pre><code class="language-bash">sudo apt install nginx
</code></pre>
<hr />
<h3>Simulate a failure (break the service)</h3>
<pre><code class="language-bash">sudo systemctl stop nginx
</code></pre>
<hr />
<h3>Troubleshoot</h3>
<pre><code class="language-bash">systemctl status nginx
curl localhost
journalctl -u nginx
</code></pre>
<p>If the website is not loading, Nginx might be down.</p>
<hr />
<h3>Fix it</h3>
<pre><code class="language-bash">sudo systemctl start nginx
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/f6adeb6d-76b2-44af-8a3c-28d9655b3d2e.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>🔹 Key Learnings</h3>
<ul>
<li><p>Processes show what is running</p>
</li>
<li><p>Services show what should be running</p>
</li>
<li><p>Logs show what actually happened</p>
</li>
<li><p><code>/var/log/auth.log</code> is critical for security monitoring</p>
</li>
<li><p><code>systemctl list-units</code> helps check running services quickly</p>
</li>
<li><p>Seeing random SSH connection attempts is normal (bots scanning servers)</p>
</li>
</ul>
<hr />
<p>This practice changed how I see Linux systems.<br />It's no longer about commands—it's about <strong>understanding behavior and fixing issues under pressure</strong>.</p>
<p>This is what DevOps really is:<br /><strong>Observe → Analyze → Fix → Verify</strong></p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic</p>
]]></content:encoded></item><item><title><![CDATA[Day 06 – Linux Fundamentals: Mastering File Read & Write]]></title><description><![CDATA[The 2 AM Production Issue…
It’s 2 AM.Your application just failed in production.
Users are complaining.Your team is waiting.And all you have… is a log file.
It’s huge. Thousands of lines.
Now the real]]></description><link>https://90-days-devops-with-shubham.hashnode.dev/day-06-linux-fundamentals-mastering-file-read-write</link><guid isPermaLink="true">https://90-days-devops-with-shubham.hashnode.dev/day-06-linux-fundamentals-mastering-file-read-write</guid><category><![CDATA[90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic]]></category><category><![CDATA[#90daysofdevops]]></category><category><![CDATA[#learninginpublic]]></category><category><![CDATA[DevOps Journey]]></category><category><![CDATA[Linux]]></category><category><![CDATA[TrainWithShubham]]></category><category><![CDATA[#DevOpsKaJosh]]></category><category><![CDATA[DevOpsKaJosh #TrainWithShubham]]></category><dc:creator><![CDATA[malathi shetty]]></dc:creator><pubDate>Sat, 11 Apr 2026 14:14:55 GMT</pubDate><content:encoded><![CDATA[<h3>The 2 AM Production Issue…</h3>
<p>It’s 2 AM.<br />Your application just failed in production.</p>
<p>Users are complaining.<br />Your team is waiting.<br />And all you have… is a <strong>log file</strong>.</p>
<p>It’s huge. Thousands of lines.</p>
<p>Now the real question is:</p>
<blockquote>
<p><em>How do you quickly read, write, and debug files in Linux without wasting time?</em></p>
</blockquote>
<p>This is where <strong>Linux file read/write commands</strong> become your superpower.</p>
<hr />
<h3>Why This Matters in DevOps</h3>
<p>In real-world DevOps:</p>
<ul>
<li><p>Logs are stored in files</p>
</li>
<li><p>Configurations are stored in files</p>
</li>
<li><p>CI/CD pipelines generate files</p>
</li>
</ul>
<p>If you can’t handle files efficiently, you can’t debug systems.</p>
<hr />
<h2>Step-by-Step Practical</h2>
<p><strong>Let’s start simple.</strong></p>
<h3>🔹 Step 1: <strong>Creating a File</strong></h3>
<pre><code class="language-shell">touch notes.txt
</code></pre>
<p><strong>What it does:</strong></p>
<ul>
<li><p>Creates an empty file named notes.txt.</p>
</li>
<li><p><em>Think of this like creating a notebook before writing anything.</em></p>
</li>
</ul>
<p>In DevOps, this is commonly used to create:</p>
<ul>
<li><p>Log files</p>
</li>
<li><p>Config files</p>
</li>
<li><p>Temporary scripts</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/d98a85f9-91ac-47c2-a88a-f136ac42b436.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>🔹 Step 2: <strong>Writing to a File (Overwrite Mode)</strong></h3>
<pre><code class="language-shell">echo "Learning DevOps Day 06" &gt; notes.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/7d4214bb-5848-4a33-9c8d-5aee7e49db2b.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Explanation:</strong></p>
<ul>
<li><p><code>&gt;</code> is called <strong>redirection</strong></p>
</li>
<li><p>It writes content into the file</p>
</li>
<li><p>If the file already exists, it overwrites everything</p>
<ul>
<li>Think of this as: "Replace everything in this file with new content"</li>
</ul>
</li>
</ul>
<p><strong>Important:</strong></p>
<ul>
<li><p>Old data is gone</p>
</li>
<li><p>Only new content remains</p>
</li>
</ul>
<p>Critical for**:**</p>
<ul>
<li><p>Writing fresh config files</p>
</li>
<li><p>Resetting logs</p>
</li>
</ul>
<hr />
<h3>🔹 Step 3: <strong>Appending to a File</strong> (Safe Mode)</h3>
<pre><code class="language-shell">echo "Practicing file read and write" &gt;&gt; notes.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/ae77e45a-307e-4d08-9fad-020c3d089474.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Explanation:</strong></p>
<ul>
<li><p><code>&gt;&gt;</code> appends content</p>
</li>
<li><p>Existing data is preserved</p>
<ul>
<li>Think of this as: "Add new content without deleting existing data"</li>
</ul>
</li>
</ul>
<p>Commonly used in**:**</p>
<ul>
<li><p>Adding logs continuously</p>
</li>
<li><p>Tracking system events</p>
</li>
</ul>
<hr />
<h3><strong>🔹</strong> Step 4: Reading Full File Content</h3>
<p>🔸 View Full File</p>
<pre><code class="language-shell">cat notes.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/aa4f3c4e-8025-474d-84de-1097c58ed21c.png" alt="" style="display:block;margin:0 auto" />

<p><strong>What it does:</strong></p>
<ul>
<li>Displays the entire file content.</li>
</ul>
<p>Common use:</p>
<ul>
<li><p>Viewing logs</p>
</li>
<li><p>Checking configs</p>
</li>
</ul>
<p>🔸View First Few Lines</p>
<pre><code class="language-shell">head heredoc.txt 
head -n 2 heredoc.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/cb4ad164-4abe-4620-836e-4be2cb728e8c.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Explanation:</strong></p>
<ul>
<li><p>Shows beginning of file</p>
</li>
<li><p>Default → first 10 lines</p>
</li>
<li><p><code>-n</code> → specify number of lines</p>
</li>
</ul>
<p>Useful for:</p>
<ul>
<li><p>Checking start of logs</p>
</li>
<li><p>Checking file structure</p>
</li>
<li><p>Reading headers</p>
</li>
</ul>
<hr />
<p>🔸View Last Few Lines</p>
<pre><code class="language-shell">tail heredoc.txt
tail -n 2 heredoc.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/bdc6d3ea-5cee-4f75-9a26-04b0d3be0b6c.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Explanation:</strong></p>
<ul>
<li>Shows last lines of file</li>
</ul>
<p>Real DevOps Power**:**</p>
<ul>
<li><p>Debugging logs</p>
</li>
<li><p>Checking latest errors</p>
</li>
</ul>
<p>🔸Real-Time Log Monitoring</p>
<pre><code class="language-shell">tail -f logs.txt
</code></pre>
<ul>
<li><p>Real-time log monitoring</p>
</li>
<li><p>Continuously watches file updates</p>
</li>
</ul>
<p>This is what engineers use during:</p>
<ul>
<li><p>Deployments</p>
</li>
<li><p>Live debugging</p>
</li>
<li><p>Monitoring systems</p>
</li>
</ul>
<hr />
<h3><strong>🔹 Step 5: Writing + Displaying Output</strong> Using <strong>tee</strong></h3>
<pre><code class="language-plaintext">echo "Logging this" | tee notes.txt
</code></pre>
<ul>
<li>Writes to file AND shows output on terminal</li>
</ul>
<h2>➕ Append with tee</h2>
<pre><code class="language-shell">echo "Linux fundamentals are important" | tee -a notes.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/b9d12cef-777e-49c5-a95c-5573d8c39f33.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Explanation:</strong></p>
<ul>
<li><p><code>tee</code> writes output to file <strong>and</strong> shows it on terminal</p>
</li>
<li><p><code>tee</code> is DevOps pipeline hero</p>
</li>
<li><p><code>-a</code> means append</p>
</li>
<li><p>Adds content without overwriting</p>
</li>
</ul>
<p>Very useful in:</p>
<ul>
<li><p>Shell scripts</p>
</li>
<li><p>Logging CI/CD pipelines</p>
</li>
<li><p>Saving logs while displaying them</p>
</li>
</ul>
<hr />
<h3>🔹 S<strong>tep 6: Adding Multiple Lines (Heredoc)</strong></h3>
<pre><code class="language-shell">cat &lt;&lt;EOF &gt;&gt; notes.txt
cat reads full file
head reads top lines
tail reads bottom lines
These skills help in DevOps
EOF
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/973dc3f7-3ec1-4686-aa85-657a6fc48d68.png" alt="" style="display:block;margin:0 auto" />

<p>Explanation:</p>
<ul>
<li><p>This is called <strong>heredoc</strong></p>
</li>
<li><p>Allows multi-line input in one command</p>
</li>
</ul>
<p>Used in:</p>
<ul>
<li><p>Writing config files</p>
</li>
<li><p>Automating scripts</p>
</li>
</ul>
<hr />
<h3><strong>🔹 Step 7: Searching Inside File</strong></h3>
<pre><code class="language-yaml">cat heredoc.txt | grep bottom
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/a2a8bbfd-2027-4648-a3d4-a12d7feb5783.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Explanation:</strong></p>
<ul>
<li>Searches and filters only the lines containing the word ‘bottom’ — extremely useful when finding errors in large logs.</li>
</ul>
<p>Used heavily in:</p>
<ul>
<li><p>Log debugging</p>
</li>
<li><p>Error searching</p>
</li>
</ul>
<hr />
<h3><strong>🔹 Step 8: Save Output + Display</strong></h3>
<pre><code class="language-shell">tail -2 heredoc.txt | tee output.txt
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/aa450b76-6c7d-4b7a-a83f-b907614f3a5e.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Explanation:</strong></p>
<ul>
<li><p>Saves output into another file</p>
</li>
<li><p>Displays at same time</p>
</li>
</ul>
<hr />
<h3><strong>Key Concepts to Remember</strong></h3>
<p>🔸 Redirection Operators</p>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/7fdc80b4-c611-48bf-864e-73fe5046c303.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3><strong>Commands Practiced</strong></h3>
<img src="https://cdn.hashnode.com/uploads/covers/68384e70844acdda2b275fa7/13ca7cf9-0317-48cb-891b-c66dd771e4b4.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>Use Cases</h3>
<p>These commands are used daily in real environments:</p>
<h3><strong>Log Monitoring</strong></h3>
<pre><code class="language-plaintext">tail -f application.log
</code></pre>
<h3>Debugging Errors</h3>
<pre><code class="language-plaintext">cat logs.txt | grep ERROR
</code></pre>
<h3>Writing Configs</h3>
<pre><code class="language-plaintext">echo "PORT=8080" &gt;&gt; .env
</code></pre>
<hr />
<h3>Learnings:</h3>
<ul>
<li><p><code>&gt;</code> can delete your data if used carelessly</p>
</li>
<li><p><code>&gt;&gt;</code> is used for appending logs safely</p>
</li>
<li><p><code>tee</code> → used in CI/CD pipelines to save logs</p>
</li>
<li><p><code>tail</code> → used to monitor logs in real-time</p>
</li>
<li><p><code>head</code> and <code>tail</code> save time when files are huge</p>
</li>
<li><p>File handling is the backbone of DevOps</p>
</li>
</ul>
<hr />
<h3>Realization</h3>
<p>I used to think:</p>
<blockquote>
<p>"Knowing basic commands = Linux mastery"</p>
</blockquote>
<p>But now I understand:</p>
<p>Real DevOps starts when you can <strong>handle real data in files efficiently</strong></p>
<hr />
<p>Day 06 might look basic.</p>
<p>But in reality…</p>
<p>👉 Every production issue<br />👉 Every failed deployment<br />👉 Every debugging session</p>
<p>…starts with <strong>reading a file</strong></p>
<p>Master this — and you don’t just “know Linux”, you start thinking like a DevOps engineer.</p>
<p>If you can:</p>
<ul>
<li><p>Read files quickly</p>
</li>
<li><p>Write safely</p>
</li>
<li><p>Extract useful data</p>
</li>
</ul>
<p>You can debug faster and automate smarter.</p>
<hr />
<p>#90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Linux #DevOpsJourney #LearningInPublic</p>
]]></content:encoded></item></channel></rss>