<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sreekanth Kuruba</title>
    <description>The latest articles on DEV Community by Sreekanth Kuruba (@sreekanth_kuruba_91721e5d).</description>
    <link>https://dev.to/sreekanth_kuruba_91721e5d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3286476%2Fc7a306ec-1c67-4d33-901a-1148effc29ce.jpg</url>
      <title>DEV Community: Sreekanth Kuruba</title>
      <link>https://dev.to/sreekanth_kuruba_91721e5d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sreekanth_kuruba_91721e5d"/>
    <language>en</language>
    <item>
      <title>Linux Troubleshooting Workflow for Beginners: A Step-by-Step Guide</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Tue, 04 Aug 2026 06:18:32 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/linux-troubleshooting-workflow-for-beginners-a-step-by-step-guide-427c</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/linux-troubleshooting-workflow-for-beginners-a-step-by-step-guide-427c</guid>
      <description>&lt;p&gt;Most Linux problems aren't actually difficult.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;They're difficult because they're often debugged in the wrong order.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many beginners immediately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restart services randomly&lt;/li&gt;
&lt;li&gt;Run commands without a plan&lt;/li&gt;
&lt;li&gt;Change configurations before understanding the problem&lt;/li&gt;
&lt;li&gt;Guess instead of observing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Experienced engineers do something different.&lt;/p&gt;

&lt;p&gt;They follow a structured troubleshooting process.&lt;/p&gt;

&lt;p&gt;This article isn't about learning new Linux commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's about knowing when and why to use the commands you've already learned throughout this Linux Beginner Series.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of it as putting everything together into one practical troubleshooting workflow that's used in real Linux and DevOps environments.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Quick Troubleshooting Workflow&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Observe
   ↓
Check System Health
   ↓
Identify Problem Type
   ↓
Read Logs
   ↓
Verify Service
   ↓
Check Network
   ↓
Check Disk
   ↓
Recent Changes
   ↓
Find the Root Cause
   ↓
Apply the Fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep this workflow in mind as you read through the guide.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 0: Observe Before You Change Anything&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before running a single command, pause for a moment.&lt;/p&gt;

&lt;p&gt;Ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What exactly is broken?&lt;/li&gt;
&lt;li&gt;When did the issue start?&lt;/li&gt;
&lt;li&gt;Is everyone affected or only some users?&lt;/li&gt;
&lt;li&gt;Is the problem constant or intermittent?&lt;/li&gt;
&lt;li&gt;What changed recently?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many troubleshooting sessions become longer because people try to fix the problem before they understand it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good troubleshooting begins with observation, not commands.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 1: Check Overall System Health&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your first goal is to understand the overall health of the system—not to fix anything yet.&lt;/p&gt;

&lt;p&gt;Useful commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;uptime
&lt;/span&gt;free &lt;span class="nt"&gt;-h&lt;/span&gt;
top
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High load average&lt;/li&gt;
&lt;li&gt;High CPU usage&lt;/li&gt;
&lt;li&gt;Low available memory&lt;/li&gt;
&lt;li&gt;Signs that the server is under heavy load&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At this stage, you're only gathering evidence.&lt;/p&gt;

&lt;p&gt;A quick system health check often tells you where to investigate next.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 2: Identify the Type of Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving deeper, classify the issue.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem Type&lt;/th&gt;
&lt;th&gt;Common Symptoms&lt;/th&gt;
&lt;th&gt;First Commands to Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CPU&lt;/td&gt;
&lt;td&gt;Slow system, high CPU usage&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;top&lt;/code&gt;, &lt;code&gt;htop&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory&lt;/td&gt;
&lt;td&gt;Applications crashing, OOM kills&lt;/td&gt;
&lt;td&gt;&lt;code&gt;free -h&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Disk&lt;/td&gt;
&lt;td&gt;"No space left on device"&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;df -h&lt;/code&gt;, &lt;code&gt;du -sh&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network&lt;/td&gt;
&lt;td&gt;Connection failures&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ping&lt;/code&gt;, &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;ip a&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service&lt;/td&gt;
&lt;td&gt;Service unavailable&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systemctl status&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application&lt;/td&gt;
&lt;td&gt;Errors or exceptions&lt;/td&gt;
&lt;td&gt;Application logs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Classification narrows your investigation instead of jumping between unrelated commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A well-classified problem is already half solved.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 3: Read the Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Logs are usually the most reliable source of information during troubleshooting.&lt;/p&gt;

&lt;p&gt;System logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-xe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specific service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Traditional log files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/nginx/error.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Search for errors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; error /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For large log files, use &lt;strong&gt;less&lt;/strong&gt; to navigate comfortably instead of opening the entire file at once.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;Tip:&lt;/strong&gt; Replace &lt;code&gt;nginx&lt;/code&gt; with the service you're troubleshooting, such as &lt;code&gt;sshd&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt;, or &lt;code&gt;apache2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Logs often tell you &lt;strong&gt;what&lt;/strong&gt; failed.&lt;/p&gt;

&lt;p&gt;Your job is to discover &lt;strong&gt;why&lt;/strong&gt; it failed.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 4: Verify the Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Never assume a service is healthy just because the application isn't responding.&lt;/p&gt;

&lt;p&gt;Check the service status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the running process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A service can be running while still failing to serve requests correctly.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The process may be running.&lt;/li&gt;
&lt;li&gt;The application may have failed during startup.&lt;/li&gt;
&lt;li&gt;The service may be unable to connect to its database.&lt;/li&gt;
&lt;li&gt;Configuration errors may prevent it from serving requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always verify the service before moving on to other areas.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 5: Check the Network&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the service looks healthy, verify connectivity.&lt;/p&gt;

&lt;p&gt;Useful commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping &amp;lt;host&amp;gt;
curl &lt;span class="nt"&gt;-I&lt;/span&gt; http://localhost:8080
ip a
ss &lt;span class="nt"&gt;-tuln&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands help answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can the server reach other systems?&lt;/li&gt;
&lt;li&gt;Is the application listening on the expected port?&lt;/li&gt;
&lt;li&gt;Is the network interface configured correctly?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many "application issues" are actually network or DNS problems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 6: Check Disk Space and Inodes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Disk-related problems are among the most common causes of Linux issues.&lt;/p&gt;

&lt;p&gt;Check disk usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check inode usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find large directories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /&lt;span class="k"&gt;*&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-hr&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A full disk—or exhausted inodes—can prevent applications from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writing log files&lt;/li&gt;
&lt;li&gt;Creating temporary files&lt;/li&gt;
&lt;li&gt;Saving uploaded data&lt;/li&gt;
&lt;li&gt;Starting correctly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if CPU and memory look healthy, disk issues can bring an application down.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 7: Look for Recent Changes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many production issues are caused by something that recently changed.&lt;/p&gt;

&lt;p&gt;Review recent logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;--since&lt;/span&gt; &lt;span class="s2"&gt;"1 hour ago"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check recent logins:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;last &lt;span class="nt"&gt;-10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Was there a recent deployment?&lt;/li&gt;
&lt;li&gt;Was a configuration changed?&lt;/li&gt;
&lt;li&gt;Was a package updated?&lt;/li&gt;
&lt;li&gt;Did anyone restart the service?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need to locate a configuration file, use tools like &lt;strong&gt;find&lt;/strong&gt; or &lt;strong&gt;whereis&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before making major configuration changes, consider creating a backup with &lt;strong&gt;tar&lt;/strong&gt; so you can easily restore the original if needed.&lt;/p&gt;

&lt;p&gt;Looking for recent changes often shortens the investigation dramatically.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 8: Find the Root Cause, Not Just the Symptom&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finding an error doesn't always mean you've found the real problem.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;A web application crashes.&lt;/p&gt;

&lt;p&gt;The logs show write failures.&lt;/p&gt;

&lt;p&gt;You check the disk.&lt;/p&gt;

&lt;p&gt;The disk is full.&lt;/p&gt;

&lt;p&gt;The application wasn't the real problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The full disk was.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Always ask yourself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Is this the root cause, or just another symptom?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This habit separates troubleshooting from guessing.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;A Simple Troubleshooting Workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Whenever something breaks, follow the same sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Observe the problem
        ↓
Check system health
        ↓
Identify the problem type
        ↓
Read the logs
        ↓
Verify the service
        ↓
Check the network
        ↓
Check disk space
        ↓
Look for recent changes
        ↓
Find the root cause
        ↓
Apply the fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Following the same workflow every time reduces guesswork and speeds up troubleshooting.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;A Real-World Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine a user reports:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"The website is down."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of restarting Nginx immediately:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check whether the service is running.&lt;/li&gt;
&lt;li&gt;Read the service logs.&lt;/li&gt;
&lt;li&gt;Notice repeated &lt;strong&gt;"No space left on device"&lt;/strong&gt; errors.&lt;/li&gt;
&lt;li&gt;Run:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Discover the disk is full.&lt;/li&gt;
&lt;li&gt;Free up disk space.&lt;/li&gt;
&lt;li&gt;Restart the service if necessary.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;The restart wasn't the solution. Finding the root cause was.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Common Beginner Mistakes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Avoid these habits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restarting services without checking logs&lt;/li&gt;
&lt;li&gt;Ignoring CPU, memory, or disk usage&lt;/li&gt;
&lt;li&gt;Running random commands without a plan&lt;/li&gt;
&lt;li&gt;Assuming the first error is the real cause&lt;/li&gt;
&lt;li&gt;Skipping recent changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good troubleshooting isn't about memorizing commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's about following a consistent process.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Linux troubleshooting isn't about knowing hundreds of commands.&lt;/p&gt;

&lt;p&gt;It's about asking the right questions in the right order.&lt;/p&gt;

&lt;p&gt;Commands help you collect evidence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A structured process helps you solve the problem.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The faster you narrow down the problem, the faster you'll reach the root cause.&lt;/p&gt;

&lt;p&gt;That's the mindset experienced engineers develop over time.&lt;/p&gt;

&lt;p&gt;Start with a simple process.&lt;/p&gt;

&lt;p&gt;Practice it consistently.&lt;/p&gt;

&lt;p&gt;You'll spend less time guessing and more time solving problems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've followed this Linux Beginner Series from the beginning, you've built a solid foundation in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux basics&lt;/li&gt;
&lt;li&gt;Filesystem structure&lt;/li&gt;
&lt;li&gt;Users &amp;amp; Permissions&lt;/li&gt;
&lt;li&gt;Processes&lt;/li&gt;
&lt;li&gt;Disk usage&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Logs&lt;/li&gt;
&lt;li&gt;Package management&lt;/li&gt;
&lt;li&gt;Finding files &amp;amp; text&lt;/li&gt;
&lt;li&gt;Viewing files efficiently&lt;/li&gt;
&lt;li&gt;File compression&lt;/li&gt;
&lt;li&gt;Troubleshooting workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's no longer just a collection of Linux commands.&lt;/p&gt;

&lt;p&gt;It's a practical foundation for understanding how Linux systems work and how to troubleshoot them with confidence.&lt;/p&gt;

&lt;p&gt;Remember:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Good engineers don't memorize every command.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;They know how to investigate problems, gather evidence, and find the root cause.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The best way to improve at troubleshooting is simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Break things in a safe environment.&lt;/li&gt;
&lt;li&gt;Fix them.&lt;/li&gt;
&lt;li&gt;Learn from them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's where real learning happens.&lt;/p&gt;

&lt;p&gt;Thank you for following this Linux Beginner Series!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Your Turn&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What's one Linux troubleshooting lesson you learned the hard way?&lt;/p&gt;

&lt;p&gt;Share your experience in the comments—your story might help another beginner avoid the same mistake.&lt;/p&gt;

&lt;p&gt;Happy learning! &lt;/p&gt;

</description>
      <category>linux</category>
      <category>sysadmin</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>File Compression in Linux Explained Simply (tar, gzip, zip &amp; unzip)</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Thu, 30 Jul 2026 06:44:14 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/file-compression-in-linux-explained-simply-tar-gzip-zip-unzip-2a1m</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/file-compression-in-linux-explained-simply-tar-gzip-zip-unzip-2a1m</guid>
      <description>&lt;p&gt;Working with files in Linux isn't just about creating and editing them.&lt;/p&gt;

&lt;p&gt;Sometimes you need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Archive multiple files into one&lt;/li&gt;
&lt;li&gt;Compress files to save disk space&lt;/li&gt;
&lt;li&gt;Share files with others&lt;/li&gt;
&lt;li&gt;Create backups&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux provides several tools for this, each with a different purpose.&lt;/p&gt;

&lt;p&gt;Let's simplify them.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is File Compression?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;File compression reduces the size of a file.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saves disk space&lt;/li&gt;
&lt;li&gt;Faster file transfers&lt;/li&gt;
&lt;li&gt;Easier backups&lt;/li&gt;
&lt;li&gt;Reduces bandwidth usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;A 100 MB log file might become a much smaller compressed file, depending on its contents.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Archive vs Compression&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many beginners think they're the same.&lt;/p&gt;

&lt;p&gt;They are not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Archive&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Combines multiple files into a single file.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;photos/
docs/
notes.txt

↓

backup.tar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Compression&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Reduces the size of a file.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;backup.tar

↓

backup.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 &lt;strong&gt;tar archives files. gzip compresses them.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;1. Create an Archive with tar&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-cvf&lt;/span&gt; backup.tar Documents/    &lt;span class="c"&gt;#Create an archive&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-tvf&lt;/span&gt; backup.tar               &lt;span class="c"&gt;#View archive contents&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xvf&lt;/span&gt; backup.tar               &lt;span class="c"&gt;#Extract an archive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;c&lt;/code&gt; → Create&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;v&lt;/code&gt; → Verbose (show progress)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;f&lt;/code&gt; → File name&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;x&lt;/code&gt; → Extract&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backups&lt;/li&gt;
&lt;li&gt;Bundling multiple files&lt;/li&gt;
&lt;li&gt;Moving folders&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;2. Compress with gzip&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Compress a file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;gzip &lt;/span&gt;file.txt          &lt;span class="c"&gt;# Creates file.txt.gz&lt;/span&gt;
&lt;span class="c"&gt;# Result&lt;/span&gt;
file.txt.gz
&lt;span class="nb"&gt;gunzip &lt;/span&gt;file.txt.gz     &lt;span class="c"&gt;# decompress&lt;/span&gt;
&lt;span class="nb"&gt;gzip&lt;/span&gt; &lt;span class="nt"&gt;-k&lt;/span&gt; file.txt       &lt;span class="c"&gt;# Keep original file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log files&lt;/li&gt;
&lt;li&gt;Large text files&lt;/li&gt;
&lt;li&gt;Saving disk space&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;3. Archive and Compress Together&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most common command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create compressed archive&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-czvf&lt;/span&gt; backup.tar.gz Documents/
&lt;span class="c"&gt;# Extract&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzvf&lt;/span&gt; backup.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;z&lt;/code&gt; → Use gzip compression&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 This is one of the most common backup commands in Linux.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;4. Working with ZIP Files&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create ZIP&lt;/span&gt;
zip &lt;span class="nt"&gt;-r&lt;/span&gt; project.zip project/
&lt;span class="c"&gt;# Extract&lt;/span&gt;
unzip project.zip
&lt;span class="c"&gt;# List contents&lt;/span&gt;
unzip &lt;span class="nt"&gt;-l&lt;/span&gt; project.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Best for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sharing files with Windows users&lt;/li&gt;
&lt;li&gt;Cross-platform compatibility&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;5. Compare the Tools&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tar&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Archive files&lt;/td&gt;
&lt;td&gt;Backups&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;gzip&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Compress files&lt;/td&gt;
&lt;td&gt;Saving space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tar + gzip&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Archive and compress&lt;/td&gt;
&lt;td&gt;Linux backups&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;zip&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Archive and compress&lt;/td&gt;
&lt;td&gt;Sharing files across operating systems&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;Real-World Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You need to back up a website before making changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create backup&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-czvf&lt;/span&gt; website-backup.tar.gz /var/www/html
&lt;span class="c"&gt;# Restore later if needed&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzvf&lt;/span&gt; website-backup.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a common practice before upgrades, migrations, or configuration changes.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Common Beginner Mistakes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thinking &lt;code&gt;tar&lt;/code&gt; compresses files by itself&lt;/li&gt;
&lt;li&gt;Forgetting &lt;code&gt;-z&lt;/code&gt; when creating &lt;code&gt;.tar.gz&lt;/code&gt; archives&lt;/li&gt;
&lt;li&gt;Compressing files that are already compressed (like &lt;code&gt;.jpg&lt;/code&gt; or &lt;code&gt;.mp4&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Extracting archives into the wrong directory&lt;/li&gt;
&lt;li&gt;Deleting backups before verifying they can be restored&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Simple Mental Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of it like packing for a trip:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;tar&lt;/strong&gt; → Put all your clothes into one suitcase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;gzip&lt;/strong&gt; → Compress the suitcase to make it smaller.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tar.gz&lt;/strong&gt; → Pack everything into one suitcase and compress it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;zip&lt;/strong&gt; → A suitcase that's easy to share with almost any operating system.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this guide you learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What file compression is&lt;/li&gt;
&lt;li&gt;Archive vs. compression&lt;/li&gt;
&lt;li&gt;Creating archives with &lt;code&gt;tar&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Compressing files with &lt;code&gt;gzip&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Creating &lt;code&gt;.tar.gz&lt;/code&gt; archives&lt;/li&gt;
&lt;li&gt;Working with ZIP files&lt;/li&gt;
&lt;li&gt;Common beginner mistakes&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;File compression is used every day by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux administrators&lt;/li&gt;
&lt;li&gt;DevOps engineers&lt;/li&gt;
&lt;li&gt;Cloud engineers&lt;/li&gt;
&lt;li&gt;Developers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you're creating backups, transferring files, or saving disk space, understanding these tools is an essential Linux skill.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt;&lt;br&gt;
You’ve now covered the essential Linux fundamentals.&lt;/p&gt;

&lt;p&gt;In the next and final post, we’ll combine everything from this series into a practical troubleshooting workflow you can use to diagnose Linux issues with confidence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next Post&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linux Troubleshooting Flow for Beginners&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for You&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Which compression format do you use most often: &lt;strong&gt;&lt;code&gt;.tar.gz&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;.zip&lt;/code&gt;&lt;/strong&gt;? And in what situation?&lt;/p&gt;




</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>Viewing Files in Linux Explained Simply (cat, less, head, tail &amp; wc)</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Tue, 21 Jul 2026 06:38:18 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/viewing-files-in-linux-explained-simply-cat-less-head-tail-wc-4epp</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/viewing-files-in-linux-explained-simply-cat-less-head-tail-wc-4epp</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finding a file is only half the job.&lt;/p&gt;

&lt;p&gt;The next step is reading it.&lt;/p&gt;

&lt;p&gt;Whether it's a configuration file, a log, or a text document, Linux provides several commands to view files efficiently.&lt;/p&gt;

&lt;p&gt;Each command has a different purpose.&lt;/p&gt;

&lt;p&gt;Knowing which one to use can save time and make troubleshooting much easier.&lt;/p&gt;

&lt;p&gt;Let's simplify them.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Not Just Use cat for Everything?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many beginners learn:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then use it for every file.&lt;/p&gt;

&lt;p&gt;It works...&lt;/p&gt;

&lt;p&gt;Until the file has &lt;strong&gt;50,000 lines&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Linux provides better tools depending on what you're trying to do.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;1. View the Entire File with &lt;code&gt;cat&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;cat&lt;/code&gt; command displays the complete contents of a file.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;config.txt
&lt;span class="nb"&gt;cat &lt;/span&gt;file1.txt file2.txt     &lt;span class="c"&gt;# Combine files&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; notes.txt             &lt;span class="c"&gt;# Create new file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small files&lt;/li&gt;
&lt;li&gt;Quick checks&lt;/li&gt;
&lt;li&gt;Combining files&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;2. Read Large Files with &lt;code&gt;less&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Large files are difficult to read with &lt;code&gt;cat&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;less /var/log/syslog
less /etc/nginx/nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful shortcuts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Space → Next page&lt;/li&gt;
&lt;li&gt;b → Previous page&lt;/li&gt;
&lt;li&gt;/text → Search&lt;/li&gt;
&lt;li&gt;q → Quit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configuration files&lt;/li&gt;
&lt;li&gt;Large logs&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;3. View the Beginning with &lt;code&gt;head&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes you only need the first few lines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;head &lt;/span&gt;file.txt
&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt; file.txt          &lt;span class="c"&gt;# First 20 lines&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checking file headers&lt;/li&gt;
&lt;li&gt;Previewing files&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;4. View the End with &lt;code&gt;tail&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Need the latest log entries?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail &lt;/span&gt;file.txt
&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt; file.txt          &lt;span class="c"&gt;# Last 20 lines&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Perfect for log files.&lt;br&gt;
Checking recent changes.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;5. Monitor Files Live with &lt;code&gt;tail -f&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most-used Linux troubleshooting commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/nginx/error.log
&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As new lines are written, they appear instantly.&lt;/p&gt;

&lt;p&gt;Stop with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl + C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Monitoring logs&lt;/li&gt;
&lt;li&gt;Watching application output&lt;/li&gt;
&lt;li&gt;Debugging services&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;6. Count with &lt;code&gt;wc&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Want to know how big a file is?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;wc &lt;/span&gt;file.txt
&lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; file.txt             &lt;span class="c"&gt;# Count only lines&lt;/span&gt;
&lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-w&lt;/span&gt; file.txt             &lt;span class="c"&gt;# Count words&lt;/span&gt;
&lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; file.txt             &lt;span class="c"&gt;# Count characters&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scripts&lt;/li&gt;
&lt;li&gt;Reports&lt;/li&gt;
&lt;li&gt;Log analysis&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Real-World Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An application isn't starting.&lt;/p&gt;

&lt;p&gt;First, check the configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# First, check the configuration file:&lt;/span&gt;
less /etc/nginx/nginx.conf

&lt;span class="c"&gt;# Monitor the error log:&lt;/span&gt;
&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/nginx/error.log

&lt;span class="c"&gt;# Need to know how many errors occurred?&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; error app.log | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a common workflow when troubleshooting Linux systems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Common Beginner Mistakes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;cat&lt;/code&gt; for huge files&lt;/li&gt;
&lt;li&gt;Forgetting &lt;code&gt;less&lt;/code&gt; supports searching&lt;/li&gt;
&lt;li&gt;Not using &lt;code&gt;tail -f&lt;/code&gt; for live logs&lt;/li&gt;
&lt;li&gt;Thinking &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;tail&lt;/code&gt; only work with 10 lines&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Simple Mental Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of these commands like reading a book.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Think of it as...&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read the whole book&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;less&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read page by page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;head&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read the first page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tail&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read the last page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tail -f&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Watch new pages being written&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Count pages, words, or characters&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this guide you learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cat&lt;/code&gt; → View complete files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;less&lt;/code&gt; → Read large files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;head&lt;/code&gt; → View the beginning&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tail&lt;/code&gt; → View the end&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tail -f&lt;/code&gt; → Monitor files live&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wc&lt;/code&gt; → Count lines, words, and characters&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Configuration files and logs are everywhere in Linux.&lt;/p&gt;

&lt;p&gt;Knowing how to read them efficiently is an essential skill for developers, system administrators, and DevOps engineers.&lt;/p&gt;

&lt;p&gt;The right command can save time and make troubleshooting much easier.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Next Post&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File Compression in Linux Explained Simply (tar, gzip, zip &amp;amp; unzip)&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for You&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Which command do you use the most when reading files in Linux?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cat&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;less&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tail&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Or something else?&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>Finding Files &amp; Text in Linux Explained Simply (find, grep, which &amp; whereis)</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Tue, 14 Jul 2026 03:03:02 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/finding-files-text-in-linux-explained-simply-find-grep-which-whereis-4lll</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/finding-files-text-in-linux-explained-simply-find-grep-which-whereis-4lll</guid>
      <description>&lt;p&gt;One of the most common questions Linux beginners ask is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Where is this file?”&lt;/li&gt;
&lt;li&gt;“How do I find a specific error in logs?”&lt;/li&gt;
&lt;li&gt;“Where is this command installed?”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux has powerful tools to answer these questions quickly.&lt;/p&gt;

&lt;p&gt;In this guide, you’ll learn the most useful search commands.&lt;/p&gt;




&lt;h3&gt;
  
  
  Finding Files vs Searching Text
&lt;/h3&gt;

&lt;p&gt;These are two different tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Finding files&lt;/strong&gt; = Locating a file or directory on the system → &lt;code&gt;find&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Searching text&lt;/strong&gt; = Looking for words inside files → &lt;code&gt;grep&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  1. Find Files with &lt;code&gt;find&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Find a specific file&lt;/span&gt;
find /home &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"nginx.conf"&lt;/span&gt;

&lt;span class="c"&gt;# Search entire system (ignore permission errors)&lt;/span&gt;
find / &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.log"&lt;/span&gt; 2&amp;gt;/dev/null

&lt;span class="c"&gt;# Find only directories&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d

&lt;span class="c"&gt;# Find only files&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; f

&lt;span class="c"&gt;# Find files larger than 100MB&lt;/span&gt;
find / &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-size&lt;/span&gt; +100M 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Useful for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finding configuration files&lt;/li&gt;
&lt;li&gt;Locating log files&lt;/li&gt;
&lt;li&gt;Finding large files&lt;/li&gt;
&lt;li&gt;Searching project directories&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best Tip:&lt;/strong&gt; Always try to narrow the search path instead of searching from &lt;code&gt;/&lt;/code&gt; whenever possible.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Search Text Inside Files with &lt;code&gt;grep&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Search for a word&lt;/span&gt;
&lt;span class="nb"&gt;grep &lt;/span&gt;error app.log

&lt;span class="c"&gt;# Case insensitive search&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; error app.log

&lt;span class="c"&gt;# Search recursively in directory&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"database"&lt;/span&gt; /etc/

&lt;span class="c"&gt;# Show line numbers&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"listen"&lt;/span&gt; nginx.conf

&lt;span class="c"&gt;# Count matches&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"failed"&lt;/span&gt; auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Useful for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Searching logs&lt;/li&gt;
&lt;li&gt;Finding configuration values&lt;/li&gt;
&lt;li&gt;Looking for error messages&lt;/li&gt;
&lt;li&gt;Debugging applications&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Find Executable Location with &lt;code&gt;which&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;which python3
which docker
which nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shows the full path of the command that will be executed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Useful for:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finding executable locations&lt;br&gt;
Checking which version of a command Linux will run&lt;br&gt;
Verifying software installation&lt;/p&gt;


&lt;h3&gt;
  
  
  4. Find Program Files with &lt;code&gt;whereis&lt;/code&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;whereis nginx
whereis python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;It can show:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Binary location&lt;br&gt;
Source files (if available)&lt;br&gt;
Manual pages&lt;/p&gt;

&lt;p&gt;Useful when you want to know where a program and its documentation are stored.&lt;/p&gt;


&lt;h3&gt;
  
  
  Bonus: Fast File Search with &lt;code&gt;locate&lt;/code&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;locate nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Much faster than &lt;code&gt;find&lt;/code&gt; because it uses a database.&lt;/p&gt;

&lt;p&gt;If it doesn't return recent files, Update database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;updatedb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: locate may not be installed by default on every Linux distribution.&lt;/p&gt;




&lt;h3&gt;
  
  
  Real-World Troubleshooting Example
&lt;/h3&gt;

&lt;p&gt;Nginx is not starting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Find config file&lt;/span&gt;
find /etc &lt;span class="nt"&gt;-name&lt;/span&gt; nginx.conf 2&amp;gt;/dev/null

&lt;span class="c"&gt;# Search for errors in logs&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; error /var/log/nginx/error.log

&lt;span class="c"&gt;# Check executable&lt;/span&gt;
which nginx

&lt;span class="c"&gt;# See all related files&lt;/span&gt;
whereis nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a common workflow during Linux troubleshooting.&lt;/p&gt;




&lt;h3&gt;
  
  
  Common Beginner Mistakes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;find /&lt;/code&gt; instead of a specific directory&lt;/li&gt;
&lt;li&gt;Forgetting &lt;code&gt;2&amp;gt;/dev/null&lt;/code&gt; when searching the whole system&lt;/li&gt;
&lt;li&gt;Confusing &lt;code&gt;find&lt;/code&gt; with &lt;code&gt;grep&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Not knowing the difference between &lt;code&gt;which&lt;/code&gt; and &lt;code&gt;whereis&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Forgetting that &lt;code&gt;locate&lt;/code&gt; may require an updated database&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Simple Mental Model
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Use For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;find&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Locate files and directories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;grep&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Search text inside files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;which&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Find executable path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;whereis&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Find program + docs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;locate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fast filename search&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this guide you learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to find files with &lt;code&gt;find&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;How to search text with &lt;code&gt;grep&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;How to locate commands with &lt;code&gt;which&lt;/code&gt; and &lt;code&gt;whereis&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;How to perform fast filename searches with &lt;code&gt;locate&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Next Post:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Viewing Files in Linux (cat, less, head, tail &amp;amp; wc)&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for You&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Which command do you use most while troubleshooting — &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, or something else?&lt;/p&gt;




</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>Linux Package Management Explained Simply (apt, dnf, yum &amp; rpm)</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Tue, 07 Jul 2026 03:13:00 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/linux-package-management-explained-simply-apt-dnf-yum-rpm-11gn</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/linux-package-management-explained-simply-apt-dnf-yum-rpm-11gn</guid>
      <description>&lt;p&gt;&lt;strong&gt;Quick Note&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my previous article, I mentioned that &lt;strong&gt;Linux Troubleshooting Flow for Beginners&lt;/strong&gt; would be the final post in this series.&lt;/p&gt;

&lt;p&gt;While preparing it, I realized there were a few practical Linux skills every beginner should learn first. These topics will make the troubleshooting guide much easier to understand and follow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Before we wrap up the series, we'll cover:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Package Management&lt;br&gt;
Finding Files &amp;amp; Text&lt;br&gt;
Viewing Files Efficiently&lt;br&gt;
File Compression&lt;/p&gt;

&lt;p&gt;Then we'll bring everything together in the final &lt;strong&gt;Linux Troubleshooting Flow for Beginners.&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Installing software on Linux is very different from Windows.&lt;/p&gt;

&lt;p&gt;On Windows, you usually download an &lt;code&gt;.exe&lt;/code&gt; installer.&lt;br&gt;&lt;br&gt;
On Linux, software is typically installed and managed using &lt;code&gt;package managers&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is one of the most practical skills every Linux beginner should learn early.&lt;/p&gt;


&lt;h3&gt;
  
  
  What is a Package?
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;package&lt;/strong&gt; is a ready-to-install bundle that contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The main program&lt;/li&gt;
&lt;li&gt;Required libraries&lt;/li&gt;
&lt;li&gt;Configuration files&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt; &lt;code&gt;nginx&lt;/code&gt;, &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;vim&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Think of a package as a ready-to-install software box.&lt;/p&gt;


&lt;h3&gt;
  
  
  What is a Package Manager?
&lt;/h3&gt;

&lt;p&gt;A package manager is a tool that installs, updates, removes, and manages software packages.&lt;br&gt;
Instead of downloading software manually, you simply run a command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt install git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The package manager automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloads packages from trusted repositories&lt;/li&gt;
&lt;li&gt;Install required dependencies automatically&lt;/li&gt;
&lt;li&gt;Upgrade installed software&lt;/li&gt;
&lt;li&gt;Removes them cleanly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of manual downloading, you just run one command.&lt;/p&gt;


&lt;h3&gt;
  
  
  Why Use a Package Manager?
&lt;/h3&gt;

&lt;p&gt;Without package managers, you would have to:&lt;/p&gt;

&lt;p&gt;Search for software manually&lt;br&gt;
Download files from websites&lt;br&gt;
Install dependencies yourself&lt;br&gt;
Update each application separately&lt;/p&gt;

&lt;p&gt;Package managers automate all of this.&lt;/p&gt;


&lt;h3&gt;
  
  
  What is a Repository?
&lt;/h3&gt;

&lt;p&gt;Package managers download software from repositories.&lt;/p&gt;

&lt;p&gt;A repository is a trusted online collection of software packages maintained by your Linux distribution.&lt;/p&gt;

&lt;p&gt;Instead of downloading software from random websites, Linux installs it securely from these repositories.&lt;/p&gt;


&lt;h3&gt;
  
  
  Common Package Managers
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Distribution&lt;/th&gt;
&lt;th&gt;Package Manager&lt;/th&gt;
&lt;th&gt;Low-level Tool&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ubuntu / Debian&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dpkg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fedora / RHEL / Rocky&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dnf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rpm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Older RHEL / CentOS&lt;/td&gt;
&lt;td&gt;&lt;code&gt;yum&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rpm&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Most Ubuntu users will use apt, while Fedora and modern RHEL-based systems use dnf.&lt;/p&gt;


&lt;h3&gt;
  
  
  Most Useful Commands
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Update Package List&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before installing software, update the package list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update          &lt;span class="c"&gt;# Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf check-update    &lt;span class="c"&gt;# Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: apt update does not upgrade installed packages.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;2. Upgrade Installed Packages&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade   &lt;span class="c"&gt;#Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf upgrade   &lt;span class="c"&gt;#Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Installs the latest available versions of your installed packages.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;3. Install a Package&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx   &lt;span class="c"&gt;#Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;nginx   &lt;span class="c"&gt;#Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example packages:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;sudo apt install git&lt;br&gt;
sudo apt install curl&lt;br&gt;
sudo apt install vim&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;4. Remove a Package&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt remove nginx    &lt;span class="c"&gt;#Ubuntu/Debian&lt;/span&gt;
&lt;span class="c"&gt;# Remove package and configuration files&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt purge nginx     
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf remove nginx    &lt;span class="c"&gt;#Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;5. Search for Packages&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt search docker    &lt;span class="c"&gt;#Ubuntu/Debian&lt;/span&gt;
dnf search docker    &lt;span class="c"&gt;#Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful when you're unsure of the exact package name.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;6. View Package Information&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt show nginx    &lt;span class="c"&gt;#Ubuntu/Debian&lt;/span&gt;
dnf info nginx    &lt;span class="c"&gt;#Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Shows details such as:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Version&lt;br&gt;
Description&lt;br&gt;
Dependencies&lt;br&gt;
Package size&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;7. List Installed Packages&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt list &lt;span class="nt"&gt;--installed&lt;/span&gt;   &lt;span class="c"&gt;#Ubuntu/Debian&lt;/span&gt;
dnf list installed     &lt;span class="c"&gt;#Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful for verifying whether software is already installed.&lt;/p&gt;




&lt;h3&gt;
  
  
  Low-Level Tool: rpm
&lt;/h3&gt;

&lt;p&gt;The rpm command works directly with RPM package files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rpm &lt;span class="nt"&gt;-q&lt;/span&gt; nginx          &lt;span class="c"&gt;# Check if installed&lt;/span&gt;
rpm &lt;span class="nt"&gt;-qi&lt;/span&gt; nginx         &lt;span class="c"&gt;# Detailed info&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usually you don't need to use rpm directly. On RPM-based systems, dnf handles package installation and dependencies for you.&lt;/p&gt;




&lt;h3&gt;
  
  
  Common Beginner Mistakes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Running &lt;code&gt;apt upgrade&lt;/code&gt; without &lt;code&gt;apt update&lt;/code&gt; first&lt;/li&gt;
&lt;li&gt;Confusing apt update with apt upgrade&lt;/li&gt;
&lt;li&gt;Installing software from random websites instead of official repositories&lt;/li&gt;
&lt;li&gt;Forgetting to use &lt;code&gt;sudo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Removing important system packages&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Simple Mental Model
&lt;/h3&gt;

&lt;p&gt;Think of a package manager like an &lt;strong&gt;App Store&lt;/strong&gt; for Linux:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Package = App&lt;/li&gt;
&lt;li&gt;Repository = App Store&lt;/li&gt;
&lt;li&gt;Package Manager = Installer + Updater&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this guide you learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What packages and package managers are&lt;/li&gt;
&lt;li&gt;Basic package management commands using apt and dnf&lt;/li&gt;
&lt;li&gt;Basic package management commands&lt;/li&gt;
&lt;li&gt;Common mistakes to avoid&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;Package management is a daily task for:&lt;/p&gt;

&lt;p&gt;Linux administrators&lt;br&gt;
DevOps engineers&lt;br&gt;
Cloud engineers&lt;br&gt;
Developers&lt;/p&gt;

&lt;p&gt;If you know how to manage packages, setting up and maintaining Linux systems becomes much easier.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Next Post:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Finding Files &amp;amp; Text in Linux Explained Simply (find, grep, which &amp;amp; whereis)&lt;/p&gt;




</description>
      <category>devops</category>
      <category>linux</category>
      <category>beginners</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>Linux Logs Explained Simply</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Tue, 30 Jun 2026 03:22:27 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/linux-logs-explained-simply-3pjn</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/linux-logs-explained-simply-3pjn</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;post: 7&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When something breaks in Linux, experienced engineers don’t guess.&lt;/p&gt;

&lt;p&gt;They check the logs.&lt;/p&gt;

&lt;p&gt;👉 Logs are the “black box recorder” of a Linux system.&lt;/p&gt;

&lt;p&gt;They tell you:&lt;/p&gt;

&lt;p&gt;what happened&lt;br&gt;
when it happened&lt;br&gt;
why it failed&lt;/p&gt;

&lt;p&gt;If you can read logs properly, you can debug almost anything.&lt;/p&gt;


&lt;h3&gt;
  
  
  What Are Logs?
&lt;/h3&gt;

&lt;p&gt;Logs are records of system and application activity.&lt;/p&gt;

&lt;p&gt;Linux constantly records:&lt;/p&gt;

&lt;p&gt;System events&lt;br&gt;
Errors&lt;br&gt;
User activity&lt;br&gt;
Application behavior&lt;/p&gt;

&lt;p&gt;Linux constantly records:&lt;/p&gt;


&lt;h3&gt;
  
  
  Where are Logs Stored?
&lt;/h3&gt;

&lt;p&gt;Most Linux logs are stored inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/var/log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check logs directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/log
&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the first place DevOps engineers check during system issues.&lt;/p&gt;




&lt;h3&gt;
  
  
  Important Log Files
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Log File&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Command to View&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/log/syslog&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;General system messages&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tail /var/log/syslog&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/log/auth.log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Login attempts &amp;amp; authentication&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tail /var/log/auth.log&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/log/kern.log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Kernel &amp;amp; hardware messages&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;dmesg&lt;/code&gt; or &lt;code&gt;tail /var/log/kern.log&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/log/nginx/error.log&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Web server errors (Nginx)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tail /var/log/nginx/error.log&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var/log/dmesg&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Boot and hardware logs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dmesg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;/var/log/apache2/ -&amp;gt; Apache logs&lt;/p&gt;

&lt;p&gt;These logs help you identify system, security, and application-level issues.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;View Logs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using&lt;/strong&gt; &lt;code&gt;cat&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good for small files.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Using&lt;/strong&gt; &lt;code&gt;less&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;less /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful keys::&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Space&lt;/code&gt; → Next page&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;b&lt;/code&gt; → Previous page&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;q&lt;/code&gt;→ Quit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Best for large log files.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Using&lt;/strong&gt; &lt;code&gt;tail&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show last 10 lines.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Real-Time Monitoring (tail -f)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 -f = follow live updates&lt;/p&gt;

&lt;p&gt;This is one of the most-used debugging commands in production servers.&lt;/p&gt;

&lt;p&gt;Stop with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl + C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Searching Logs with grep&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep &lt;/span&gt;error /var/log/syslog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Case-insensitive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; failed /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show latest matching errors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep &lt;/span&gt;error /var/log/syslog | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Essential for filtering huge logs quickly.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Boot &amp;amp; Hardware Logs (dmesg)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;dmesg&lt;/p&gt;

&lt;p&gt;Shows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Boot messages&lt;/li&gt;
&lt;li&gt;Hardware detection&lt;/li&gt;
&lt;li&gt;Kernel events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Useful for startup and hardware troubleshooting.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Modern Log System:&lt;/strong&gt; &lt;code&gt;journalctl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Modern Linux systems use &lt;strong&gt;systemd logs&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recent errors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-xe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specific service logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Live monitoring:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Last 1 hour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;--since&lt;/span&gt; &lt;span class="s2"&gt;"1 hour ago"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 journalctl is the modern replacement for many traditional log files.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is Log Rotation?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Logs grow continuously.&lt;/p&gt;

&lt;p&gt;Without cleanup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;disks fill up&lt;/li&gt;
&lt;li&gt;systems slow down&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux automatically rotates logs using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;logrotate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Old logs are compressed or removed automatically.&lt;/p&gt;




&lt;h3&gt;
  
  
  Real-Life Troubleshooting Example
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Website is not working.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status nginx
&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/nginx/error.log
journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; nginx &lt;span class="nt"&gt;-xe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 In real systems, logs usually reveal the exact root cause.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚠️ Common Beginner Mistakes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;guessing instead of checking logs&lt;/li&gt;
&lt;li&gt;using cat on huge files&lt;/li&gt;
&lt;li&gt;deleting logs blindly&lt;/li&gt;
&lt;li&gt;ignoring tail -f&lt;/li&gt;
&lt;li&gt;assuming service is healthy because it says “active”&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Simple Mental Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of logs like CCTV recordings:&lt;/p&gt;

&lt;p&gt;system logs → building activity&lt;br&gt;
auth logs → door access records&lt;br&gt;
kernel logs → hardware monitoring&lt;br&gt;
app logs → employee activity&lt;/p&gt;

&lt;p&gt;👉 Debugging Linux = investigating evidence&lt;/p&gt;




&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;what logs are&lt;br&gt;
where logs are stored (&lt;code&gt;/var/log&lt;/code&gt;)&lt;br&gt;
important log files&lt;br&gt;
&lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;less&lt;/code&gt;, &lt;code&gt;tail&lt;/code&gt;&lt;br&gt;
live monitoring with &lt;code&gt;tail -f&lt;/code&gt;&lt;br&gt;
searching logs with &lt;code&gt;grep&lt;/code&gt;&lt;br&gt;
boot logs using &lt;code&gt;dmesg&lt;/code&gt;&lt;br&gt;
modern logging with &lt;code&gt;journalctl&lt;/code&gt;&lt;br&gt;
log rotation basics&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Logs Matter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Logs are the foundation of:&lt;/p&gt;

&lt;p&gt;Linux troubleshooting&lt;br&gt;
DevOps debugging&lt;br&gt;
production incident response&lt;br&gt;
server monitoring&lt;br&gt;
security analysis&lt;/p&gt;

&lt;p&gt;👉 The better you read logs, the faster you solve problems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;End of Linux Beginner Series&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You now learned:&lt;/p&gt;

&lt;p&gt;Linux basics&lt;br&gt;
filesystem structure&lt;br&gt;
permissions&lt;br&gt;
users &amp;amp; groups&lt;br&gt;
processes&lt;br&gt;
disk usage&lt;br&gt;
networking&lt;br&gt;
logs &amp;amp; troubleshooting&lt;/p&gt;

&lt;p&gt;That’s already more Linux knowledge than most beginners have.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Next Step:&lt;/strong&gt;&lt;br&gt;
Linux Troubleshooting Flow for Beginners&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Final Question&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Which topic in this Linux series helped you the most?&lt;/p&gt;

&lt;p&gt;And what Linux topic should the next series cover?&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>How CoreDNS Powers Service Discovery in Kubernetes</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Tue, 23 Jun 2026 12:00:47 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/how-coredns-powers-service-discovery-in-kubernetes-5fp1</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/how-coredns-powers-service-discovery-in-kubernetes-5fp1</guid>
      <description>&lt;p&gt;CoreDNS is the DNS server that powers service discovery in Kubernetes. This post explains how Pods translate Service names into IP addresses, explores common DNS records, and provides practical troubleshooting commands for debugging connectivity issues.&lt;/p&gt;

&lt;p&gt;In the previous post, we learned how Kubernetes Services provide stable virtual IPs for Pods.&lt;/p&gt;

&lt;p&gt;But another question remains:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do applications find those Services?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before kube-proxy can forward traffic to a Service, Kubernetes first needs to translate the Service name into its ClusterIP. That's exactly what &lt;strong&gt;CoreDNS&lt;/strong&gt; does.&lt;/p&gt;

&lt;p&gt;Applications rarely communicate using IP addresses. Instead, they use names such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;backend-service&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mysql-service&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;redis-service&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So how does a Pod translate those names into IP addresses?&lt;/p&gt;

&lt;p&gt;That's where &lt;strong&gt;CoreDNS&lt;/strong&gt; comes in.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Do We Need DNS in Kubernetes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine a frontend application connecting to a backend Service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without DNS:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Backend IP = 10.96.15.21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the Service IP changes, the application configuration must change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With DNS:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;backend-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CoreDNS automatically resolves the name to the correct Service IP.&lt;/p&gt;

&lt;p&gt;This allows applications to communicate without knowing actual IP addresses.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What Is CoreDNS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CoreDNS is the DNS server for Kubernetes clusters.&lt;/p&gt;

&lt;p&gt;It watches Kubernetes resources and automatically creates DNS records for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Services&lt;/li&gt;
&lt;li&gt;Pods (optional)&lt;/li&gt;
&lt;li&gt;Namespaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Applications can then use Service names instead of IP addresses.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Where Does CoreDNS Run?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CoreDNS runs as Pods inside the &lt;code&gt;kube-system&lt;/code&gt; namespace.&lt;/p&gt;

&lt;p&gt;Verify this with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typical output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;coredns-xxxxx
coredns-yyyyy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiple replicas provide high availability.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;How Service Discovery Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose we have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Service Name:&lt;/strong&gt; &lt;code&gt;backend-service&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Namespace:&lt;/strong&gt; &lt;code&gt;default&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ClusterIP:&lt;/strong&gt; &lt;code&gt;10.96.15.21&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A Pod sends a request to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;backend-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CoreDNS resolves it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10.96.15.21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application never needs to know the actual IP address.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Kubernetes DNS Naming&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;DNS Name&lt;/th&gt;
&lt;th&gt;Used When&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend-service&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Same namespace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend-service.default&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify the namespace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend-service.default.svc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Include the Service domain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend-service.default.svc.cluster.local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fully Qualified Domain Name (FQDN)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Most applications simply use &lt;code&gt;backend-service&lt;/code&gt; because Kubernetes automatically appends the remaining DNS suffix.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why Does &lt;code&gt;backend-service&lt;/code&gt; Work Without Typing the Full DNS Name?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every Pod receives a DNS configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/resolv.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It contains the &lt;strong&gt;CoreDNS nameserver&lt;/strong&gt; and &lt;strong&gt;search domains&lt;/strong&gt;, allowing short Service names like &lt;code&gt;backend-service&lt;/code&gt; to resolve automatically without typing the full FQDN.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;DNS Lookup Flow&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Application Pod
        ↓
DNS Query
        ↓
CoreDNS
        ↓
Service ClusterIP
        ↓
kube-proxy
        ↓
Backend Pod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The entire process usually takes only a few milliseconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Important DNS Records
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ClusterIP Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CoreDNS returns the Service IP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;backend-service → 10.96.15.21
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Headless Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the Service uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;clusterIP&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CoreDNS returns the individual Pod IPs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;database-0
database-1
database-2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is commonly used by StatefulSets.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common DNS Problems and Solutions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Service name not resolving?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Verify the Service exists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get svc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Test DNS from a Pod&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &amp;lt;pod&amp;gt; &lt;span class="nt"&gt;--&lt;/span&gt; nslookup backend-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Check CoreDNS Pods&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. View CoreDNS Logs&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system deployment/coredns
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Why CoreDNS Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Without CoreDNS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Applications would need hardcoded IP addresses.&lt;/li&gt;
&lt;li&gt;Configuration changes would happen frequently.&lt;/li&gt;
&lt;li&gt;Service discovery would become difficult.&lt;/li&gt;
&lt;li&gt;Microservices communication would break easily.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CoreDNS makes Kubernetes applications independent of changing IP addresses.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pods communicate using names, not IP addresses.&lt;/p&gt;

&lt;p&gt;CoreDNS acts as the phonebook of Kubernetes, translating Service names into IP addresses.&lt;/p&gt;

&lt;p&gt;Understanding CoreDNS helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debug Service discovery problems.&lt;/li&gt;
&lt;li&gt;Troubleshoot application connectivity.&lt;/li&gt;
&lt;li&gt;Understand Kubernetes networking better.&lt;/li&gt;
&lt;li&gt;Build resilient microservices.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Next in the Series:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Ingress Explained – How External Traffic Enters Your Kubernetes Cluster.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>cloudnative</category>
      <category>networking</category>
    </item>
    <item>
      <title>Linux Networking Basics for Beginners</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Tue, 23 Jun 2026 05:18:20 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/linux-networking-basics-for-beginners-3e2e</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/linux-networking-basics-for-beginners-3e2e</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Post: 6&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most Linux “server down” problems are not actually system failures.&lt;/p&gt;

&lt;p&gt;They are network issues.&lt;/p&gt;

&lt;p&gt;👉 The system is running fine&lt;br&gt;
👉 But it cannot talk to the outside world&lt;/p&gt;

&lt;p&gt;That’s why networking is one of the most critical skills in Linux, DevOps, and cloud environments.&lt;/p&gt;

&lt;p&gt;Let’s simplify it.&lt;/p&gt;


&lt;h2&gt;
  
  
  Basic Networking Concepts (Must Know First)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is an IP Address?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An IP address is a unique address assigned to a device in a network.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;192.168.1.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Used for communication between systems.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is localhost (&lt;code&gt;127.0.0.1&lt;/code&gt;)?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;localhost&lt;/code&gt; refers to your own computer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;127.0.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 This means “your own computer”&lt;/p&gt;

&lt;p&gt;Used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;testing apps&lt;/li&gt;
&lt;li&gt;local development&lt;/li&gt;
&lt;li&gt;debugging services&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;What is DNS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DNS (Domain Name System) converts domain names into IP addresses.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;google.com → 142.x.x.x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Without DNS, we would need to remember IPs manually.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What is a Port?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ports are like “doors” for services.&lt;/p&gt;

&lt;p&gt;Ports are communication endpoints used by applications.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Port 80 → HTTP&lt;/li&gt;
&lt;li&gt;Port 443 → HTTPS&lt;/li&gt;
&lt;li&gt;Port 22 → SSH&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 One server can run multiple services using different ports.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Check Internet Connectivity with &lt;code&gt;ping&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Limit requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;ping -c 4 google.com
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 First command used in troubleshooting.&lt;/p&gt;

&lt;p&gt;Checks:&lt;/p&gt;

&lt;p&gt;is host reachable?&lt;br&gt;
is network working?&lt;/p&gt;


&lt;h3&gt;
  
  
  2. Test Web Requests with &lt;code&gt;curl&lt;/code&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Headers only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;curl -I google.com   #&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Show only HTTP headers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verbose mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;curl -v google.com   #&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Verbose &lt;span class="o"&gt;(&lt;/span&gt;detailed output&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Used for:&lt;/p&gt;

&lt;p&gt;API testing&lt;br&gt;
checking web services&lt;br&gt;
debugging HTTP issues&lt;/p&gt;


&lt;h3&gt;
  
  
  3. Check DNS Resolution
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nslookup google.com

&lt;span class="c"&gt;# More detailed DNS lookup&lt;/span&gt;
dig google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;👉 If DNS fails:&lt;/p&gt;

&lt;p&gt;website won’t open&lt;br&gt;
even if internet is working&lt;/p&gt;


&lt;h3&gt;
  
  
  4. Check Your IP Address
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip a          &lt;span class="c"&gt;# full network interface details&lt;/span&gt;
&lt;span class="nb"&gt;hostname&lt;/span&gt; &lt;span class="nt"&gt;-I&lt;/span&gt;   &lt;span class="c"&gt;# Show only IP addresses&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;👉 Shows your system’s network identity&lt;/p&gt;


&lt;h3&gt;
  
  
  5. Check Routing path
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip route
ip route | &lt;span class="nb"&gt;grep &lt;/span&gt;default   &lt;span class="c"&gt;# Show default gateway&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;👉 Shows how traffic leaves your system&lt;/p&gt;


&lt;h3&gt;
  
  
  6. Check Open Ports
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss &lt;span class="nt"&gt;-tuln&lt;/span&gt;               &lt;span class="c"&gt;# Show listening ports&lt;/span&gt;
ss &lt;span class="nt"&gt;-tuln&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; :80    &lt;span class="c"&gt;# Check specific port&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Shows which services are listening on your system.&lt;/p&gt;

&lt;p&gt;Modern replacement for &lt;code&gt;netstat&lt;/code&gt;.&lt;/p&gt;


&lt;h3&gt;
  
  
  7. Trace Network Path with &lt;code&gt;traceroute&lt;/code&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;traceroute google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Install if needed:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;traceroute    &lt;span class="c"&gt;# Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;traceroute    &lt;span class="c"&gt;# Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Shows where delay or failure happens in network path&lt;/p&gt;




&lt;h3&gt;
  
  
  8. Enhanced Traceroute with &lt;code&gt;mtr&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;mtr&lt;/strong&gt; is a powerful combination of &lt;strong&gt;ping&lt;/strong&gt; and &lt;strong&gt;traceroute&lt;/strong&gt;. It continuously monitors the connection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mtr google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install if needed:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mtr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Combines:&lt;/p&gt;

&lt;p&gt;ping&lt;br&gt;
traceroute&lt;/p&gt;

&lt;p&gt;Real-time network diagnostics tool&lt;/p&gt;




&lt;h3&gt;
  
  
  Simple Troubleshooting Flow (VERY IMPORTANT)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;ping 8.8.8.8        → check internet&lt;/li&gt;
&lt;li&gt;ping google.com     → check DNS&lt;/li&gt;
&lt;li&gt;ip a                → check IP&lt;/li&gt;
&lt;li&gt;ip route            → check routing&lt;/li&gt;
&lt;li&gt;curl -I site        → check HTTP&lt;/li&gt;
&lt;li&gt;traceroute / mtr    → find failure point&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;👉 This is real DevOps incident workflow&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚠️ Common Beginner Mistakes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;assuming internet is down (when DNS is broken)&lt;/li&gt;
&lt;li&gt;not checking IP address first&lt;/li&gt;
&lt;li&gt;using old tools (ifconfig, netstat)&lt;/li&gt;
&lt;li&gt;routing checks&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Simple Mental Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of networking like delivery:&lt;/p&gt;

&lt;p&gt;IP → house address&lt;br&gt;
DNS → contact name → address lookup&lt;br&gt;
Port → door number&lt;br&gt;
Routing → delivery path&lt;br&gt;
ping → “are you there?”&lt;/p&gt;




&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;You learned:&lt;/p&gt;

&lt;p&gt;IP address basics&lt;br&gt;
localhost (127.0.0.1)&lt;br&gt;
DNS resolution&lt;br&gt;
ports (80, 443, 22)&lt;br&gt;
&lt;code&gt;ping&lt;/code&gt; → connectivity&lt;br&gt;
&lt;code&gt;curl&lt;/code&gt; → web/API testing&lt;br&gt;
&lt;code&gt;nslookup&lt;/code&gt;, &lt;code&gt;dig&lt;/code&gt; → DNS tools&lt;br&gt;
&lt;code&gt;ip a&lt;/code&gt;, &lt;code&gt;ip route&lt;/code&gt; → network config&lt;br&gt;
&lt;code&gt;ss&lt;/code&gt; → open ports&lt;br&gt;
&lt;code&gt;traceroute&lt;/code&gt;, &lt;code&gt;mtr&lt;/code&gt; → path debugging&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Networking is the backbone of:&lt;/p&gt;

&lt;p&gt;cloud systems&lt;br&gt;
DevOps pipelines&lt;br&gt;
APIs&lt;br&gt;
production servers&lt;/p&gt;

&lt;p&gt;👉 If networking breaks, everything breaks&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Next Post:&lt;/strong&gt;&lt;br&gt;
Linux Logs Explained Simply,(journalctl, /var/log)&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for You&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you ever faced a situation where:&lt;/p&gt;

&lt;p&gt;internet was working&lt;br&gt;
but website still didn’t load?&lt;/p&gt;

&lt;p&gt;That’s usually DNS — I’ll show debugging in Part 8.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>Real production lesson: Logs can fill a server faster than applications. Always monitor /var/log growth before it becomes an outage. 

#sre #devops</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Mon, 22 Jun 2026 11:33:25 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/real-production-lesson-logs-can-fill-a-server-faster-than-applications-always-monitor-varlog-22ol</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/real-production-lesson-logs-can-fill-a-server-faster-than-applications-always-monitor-varlog-22ol</guid>
      <description></description>
      <category>devops</category>
      <category>linux</category>
      <category>monitoring</category>
      <category>sre</category>
    </item>
    <item>
      <title>Real production lesson: Logs can fill a server faster than applications. Always monitor /var/log growth before it becomes an outage. #sre #devops</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Mon, 22 Jun 2026 11:33:02 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/real-production-lesson-logs-can-fill-a-server-faster-than-applications-always-monitor-varlog-1i4b</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/real-production-lesson-logs-can-fill-a-server-faster-than-applications-always-monitor-varlog-1i4b</guid>
      <description></description>
      <category>devops</category>
      <category>linux</category>
      <category>monitoring</category>
      <category>sre</category>
    </item>
    <item>
      <title>SSH Sessions Dropping Frequently? Here's Exactly How I Troubleshoot It</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Sat, 20 Jun 2026 07:56:43 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/ssh-sessions-dropping-frequently-heres-exactly-how-i-troubleshoot-it-562p</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/ssh-sessions-dropping-frequently-heres-exactly-how-i-troubleshoot-it-562p</guid>
      <description>&lt;p&gt;Ever had your SSH session disconnect right in the middle of a production deployment?&lt;/p&gt;

&lt;p&gt;I have.&lt;/p&gt;

&lt;p&gt;After getting burned by it a few times, I created a simple troubleshooting checklist that helps me quickly find the root cause.&lt;/p&gt;




&lt;p&gt;You're in the middle of a critical deployment or debugging session on a production server.&lt;/p&gt;

&lt;p&gt;Suddenly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Connection to 172.20.10.5 closed by remote host.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You reconnect… and it happens again 5 minutes later.&lt;/p&gt;

&lt;p&gt;If this sounds familiar, you're not alone. SSH disconnections are one of the most frustrating issues for developers and DevOps engineers.&lt;/p&gt;

&lt;p&gt;Here's the exact checklist I use to diagnose and fix recurring SSH disconnect problems.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Check Network Connectivity First
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping &amp;lt;server-ip&amp;gt;
traceroute &amp;lt;server-ip&amp;gt;
mtr &amp;lt;server-ip&amp;gt;          &lt;span class="c"&gt;# Great for intermittent network issues&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Packet loss&lt;/li&gt;
&lt;li&gt;High latency&lt;/li&gt;
&lt;li&gt;Unstable VPN connections&lt;/li&gt;
&lt;li&gt;ISP connectivity issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes the problem isn't the server at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Check Server Resource Usage
&lt;/h2&gt;

&lt;p&gt;Overloaded servers often become unresponsive and can drop SSH sessions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top
htop
free &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;span class="nb"&gt;uptime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pay special attention to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High load average&lt;/li&gt;
&lt;li&gt;Very low available memory&lt;/li&gt;
&lt;li&gt;OOM (Out Of Memory) Killer activity&lt;/li&gt;
&lt;li&gt;CPU saturation&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Check SSH Logs
&lt;/h2&gt;

&lt;p&gt;SSH logs often tell you exactly why the connection was terminated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ubuntu/Debian
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/auth.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  RHEL/CentOS/Rocky
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/secure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Modern systems
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; sshd &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timeout messages&lt;/li&gt;
&lt;li&gt;Authentication failures&lt;/li&gt;
&lt;li&gt;SSH daemon restarts&lt;/li&gt;
&lt;li&gt;Connection errors&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Fix SSH Timeout Settings (Server Side)
&lt;/h2&gt;

&lt;p&gt;Edit the SSH daemon configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add or modify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ClientAliveInterval 300
ClientAliveCountMax 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send a keepalive packet every 300 seconds.&lt;/li&gt;
&lt;li&gt;Disconnect only after 3 failed responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Restart SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. Configure Client-Side Keepalive
&lt;/h2&gt;

&lt;p&gt;Create or edit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Host &lt;span class="k"&gt;*&lt;/span&gt;
    ServerAliveInterval 60
    ServerAliveCountMax 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps prevent many idle SSH disconnections.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Check Firewalls, VPNs &amp;amp; Load Balancers
&lt;/h2&gt;

&lt;p&gt;Some common culprits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Firewall idle timeouts&lt;/li&gt;
&lt;li&gt;Cloud load balancer timeouts&lt;/li&gt;
&lt;li&gt;VPN session timeouts&lt;/li&gt;
&lt;li&gt;NAT session expiration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always troubleshoot the entire network path, not just the server.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Use &lt;code&gt;tmux&lt;/code&gt; or &lt;code&gt;screen&lt;/code&gt; (A Life Saver)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tmux
&lt;span class="c"&gt;# Do your work&lt;/span&gt;
Ctrl + B &lt;span class="k"&gt;then &lt;/span&gt;D   &lt;span class="c"&gt;# Detach&lt;/span&gt;
tmux attach       &lt;span class="c"&gt;# Reconnect later&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a must-have habit for anyone working on Linux servers.&lt;/p&gt;

&lt;p&gt;Even if your SSH session disconnects, your processes keep running.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Check System Limits
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ulimit&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/security/limits.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Low limits can sometimes cause unexpected connection issues under heavy load.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bonus Tip: Enable SSH Debugging
&lt;/h2&gt;

&lt;p&gt;If the issue is difficult to reproduce:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-vvv&lt;/span&gt; user@server-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The verbose output often reveals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authentication issues&lt;/li&gt;
&lt;li&gt;Timeout problems&lt;/li&gt;
&lt;li&gt;Network interruptions&lt;/li&gt;
&lt;li&gt;Key exchange failures&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  A Real Production Incident
&lt;/h2&gt;

&lt;p&gt;During a late-night deployment, our SSH sessions kept disconnecting every 3–4 minutes.&lt;/p&gt;

&lt;p&gt;We initially suspected the server itself. CPU and memory looked fine, and SSH logs showed nothing unusual.&lt;/p&gt;

&lt;p&gt;The actual culprit?&lt;/p&gt;

&lt;p&gt;A firewall between our workstation and the server had an aggressive idle timeout configured.&lt;/p&gt;

&lt;p&gt;Increasing the timeout and enabling SSH keepalives fixed the issue completely.&lt;/p&gt;

&lt;p&gt;That incident taught me an important lesson:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't just troubleshoot the server. Troubleshoot the entire path between your machine and the server.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  My SSH Troubleshooting Flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SSH Keeps Disconnecting
        ↓
1. Network (ping/mtr)
        ↓
2. Server Resources (top/free)
        ↓
3. SSH Logs
        ↓
4. Timeout Settings (Server + Client)
        ↓
5. Firewall / LB / VPN
        ↓
6. Use tmux (always)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Most SSH disconnections usually come down to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Idle timeout settings&lt;/li&gt;
&lt;li&gt;Unstable network connections&lt;/li&gt;
&lt;li&gt;Resource exhaustion&lt;/li&gt;
&lt;li&gt;Firewall or VPN timeouts&lt;/li&gt;
&lt;li&gt;Missing keepalive configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One final tip: I never perform deployments directly in a normal SSH session anymore.&lt;/p&gt;

&lt;p&gt;Everything runs inside &lt;code&gt;tmux&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Even if my connection drops, my work keeps running.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Have you ever faced a strange SSH disconnect issue? I'd love to hear your experience in the comments.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>ssh</category>
      <category>troubleshooting</category>
    </item>
    <item>
      <title>Linux Disk Usage Explained Simply</title>
      <dc:creator>Sreekanth Kuruba</dc:creator>
      <pubDate>Wed, 17 Jun 2026 03:00:00 +0000</pubDate>
      <link>https://dev.to/sreekanth_kuruba_91721e5d/linux-disk-usage-explained-simply-46l2</link>
      <guid>https://dev.to/sreekanth_kuruba_91721e5d/linux-disk-usage-explained-simply-46l2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;post: 5&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One of the fastest ways to break a Linux system is this:&lt;/p&gt;

&lt;p&gt;❌ Running out of disk space&lt;/p&gt;

&lt;p&gt;When disk fills up:&lt;/p&gt;

&lt;p&gt;apps crash&lt;br&gt;
logs stop writing&lt;br&gt;
deployments fail&lt;br&gt;
servers become unstable&lt;/p&gt;

&lt;p&gt;👉 That’s why disk usage monitoring is critical in Linux and DevOps.&lt;/p&gt;

&lt;p&gt;Let’s simplify it.&lt;/p&gt;


&lt;h2&gt;
  
  
  Disk Usage Basics (You Must Know This First)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is Storage in Linux?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Storage is where Linux keeps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Files&lt;/li&gt;
&lt;li&gt;Applications&lt;/li&gt;
&lt;li&gt;Logs&lt;/li&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HDD&lt;/li&gt;
&lt;li&gt;SSD&lt;/li&gt;
&lt;li&gt;Cloud volumes (AWS, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If storage becomes full:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Applications may crash&lt;/li&gt;
&lt;li&gt;Logs may stop writing&lt;/li&gt;
&lt;li&gt;System can become unstable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux uses storage through filesystems.&lt;/p&gt;


&lt;h3&gt;
  
  
  What is a Filesystem?
&lt;/h3&gt;

&lt;p&gt;A filesystem is how Linux organizes storage.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ext4&lt;/li&gt;
&lt;li&gt;xfs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux mounts filesystems into directories like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/home&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/var&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  File Size vs Disk Usage
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File size&lt;/strong&gt; → Size of a single file&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disk usage&lt;/strong&gt; → Total space consumed by files and directories&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ls -lh&lt;/code&gt; → Check file size&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;du -sh&lt;/code&gt; → Check directory disk usage&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  What is Mounting?
&lt;/h3&gt;

&lt;p&gt;Linux attaches storage devices to directories using a process called mounting.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/&lt;/code&gt; → Main filesystem&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/home&lt;/code&gt; → User files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/var&lt;/code&gt; → Logs and application data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why &lt;code&gt;df -h&lt;/code&gt; shows a &lt;strong&gt;Mounted on&lt;/strong&gt; column.&lt;/p&gt;


&lt;h3&gt;
  
  
  1. Check Overall Disk Usage with &lt;code&gt;df&lt;/code&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Example Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem      Size  Used  Avail  Use%  Mounted on
/dev/sda1        50G   32G   18G   65%   /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Meaning:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Size → Total disk&lt;/li&gt;
&lt;li&gt;Used → used space&lt;/li&gt;
&lt;li&gt;Avail → Free space&lt;/li&gt;
&lt;li&gt;Use% → usage percentage&lt;/li&gt;
&lt;li&gt;Mounted on → where disk is attached&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 First command to run when server behaves weirdly.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Check Folder and Directory Size with &lt;code&gt;du&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /home
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /var/log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-s&lt;/code&gt; → Summary (total size only)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-h&lt;/code&gt; → Human readable (KB, MB, GB)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Used to find which folder is consuming space&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Find Large Files in the System
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find / &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-size&lt;/span&gt; +100M 2&amp;gt;/dev/null
find / &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-size&lt;/span&gt; +500M 2&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Can take time on large systems.&lt;/p&gt;

&lt;p&gt;👉 Common use:&lt;/p&gt;

&lt;p&gt;large logs&lt;br&gt;
backups&lt;br&gt;
unused media files&lt;/p&gt;


&lt;h3&gt;
  
  
  4. Find Biggest Directories (Very Important)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; /&lt;span class="k"&gt;*&lt;/span&gt; 2&amp;gt;/dev/null | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-hr&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;👉 Shows top 10 largest directories&lt;/p&gt;

&lt;p&gt;This is one of the most used DevOps troubleshooting commands.&lt;/p&gt;


&lt;h3&gt;
  
  
  5. Disk Full but Space Looks Free? (INODES)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;What are inodes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inodes store metadata about files.&lt;/p&gt;

&lt;p&gt;👉 Problem:&lt;/p&gt;

&lt;p&gt;Disk shows free space&lt;br&gt;
But system says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No space left on device
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Cause:&lt;br&gt;
Too many small files.&lt;/p&gt;

&lt;p&gt;This is very common in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;log systems&lt;/li&gt;
&lt;li&gt;microservices&lt;/li&gt;
&lt;li&gt;temp file-heavy apps&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  6. Deleted Files Still Using Space
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsof | &lt;span class="nb"&gt;grep &lt;/span&gt;deleted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;👉 Happens when:&lt;/p&gt;

&lt;p&gt;file is deleted&lt;br&gt;
but process is still using it&lt;/p&gt;

&lt;p&gt;So disk space is NOT freed.&lt;/p&gt;


&lt;h3&gt;
  
  
  Bonus Tool: &lt;code&gt;ncdu&lt;/code&gt; (Best for Beginners)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;ncdu   &lt;span class="c"&gt;# Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;ncdu   &lt;span class="c"&gt;# Fedora/RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ncdu /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why it’s powerful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;interactive UI&lt;/li&gt;
&lt;li&gt;easy navigation&lt;/li&gt;
&lt;li&gt;visual disk breakdown&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Widely used by DevOps engineers for fast debugging&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Basic Cleanup Tips&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove old logs carefully&lt;/li&gt;
&lt;li&gt;delete unused backups&lt;/li&gt;
&lt;li&gt;Clear package cache when needed&lt;/li&gt;
&lt;li&gt;Always verify before using rm -rf&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚠️ Common Beginner mistakes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Disk shows free space but system says full → Check inodes (&lt;code&gt;df -i&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;using rm -rf without checking size&lt;/li&gt;
&lt;li&gt;ignoring /var/log growth&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Simple Mental Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of disk like a room:&lt;/p&gt;

&lt;p&gt;/home → personal items&lt;br&gt;
/var → messy logs piling up&lt;br&gt;
/usr → installed apps&lt;br&gt;
/tmp → temporary trash&lt;/p&gt;

&lt;p&gt;👉 When room is full → system slows down&lt;/p&gt;




&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this guide you learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;df -h&lt;/code&gt; → Overall disk usage&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;du -sh&lt;/code&gt; → Folder size&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;find&lt;/code&gt; → Locate large files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;df -i&lt;/code&gt; → Check inodes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;lsof | grep deleted&lt;/code&gt; → Find deleted open files&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ncdu&lt;/code&gt; → Interactive disk usage analyzer&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Why This Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Disk issues are one of the most common production failures in:&lt;/p&gt;

&lt;p&gt;DevOps systems&lt;br&gt;
cloud servers&lt;br&gt;
databases&lt;br&gt;
CI/CD pipelines&lt;/p&gt;

&lt;p&gt;👉 Knowing this = real-world Linux skill&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Next Post:&lt;/strong&gt;&lt;br&gt;
Linux Networking Basics for Beginners,(ping, curl, ip, ss, etc.)&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Question for You&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you ever faced a server where disk was full but you couldn’t find why?&lt;/p&gt;

&lt;p&gt;That’s usually inode or deleted file issues — I’ll show debugging tricks in Part 7.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>sysadmin</category>
    </item>
  </channel>
</rss>
