<?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: Md Mohiuddin</title>
    <description>The latest articles on DEV Community by Md Mohiuddin (@themdmohiuddin).</description>
    <link>https://dev.to/themdmohiuddin</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%2F3774313%2F029926fa-35c7-423a-a3b3-4a09ce9d1d00.png</url>
      <title>DEV Community: Md Mohiuddin</title>
      <link>https://dev.to/themdmohiuddin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/themdmohiuddin"/>
    <language>en</language>
    <item>
      <title>Pull Requests, Code Reviews &amp; Git Rebase</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Sun, 09 Aug 2026 17:54:48 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/pull-requests-code-reviews-git-rebase-5fe1</link>
      <guid>https://dev.to/themdmohiuddin/pull-requests-code-reviews-git-rebase-5fe1</guid>
      <description>&lt;p&gt;If you've already learned Git commits, branching, and merging, you've mastered the mechanics of version control. But knowing Git alone doesn't make you effective on a real engineering team.&lt;/p&gt;

&lt;p&gt;In this article, we'll cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What Pull Requests (PRs) actually are&lt;/li&gt;
&lt;li&gt;How professional code reviews work&lt;/li&gt;
&lt;li&gt;Why &lt;code&gt;.gitignore&lt;/code&gt; is essential&lt;/li&gt;
&lt;li&gt;The dangers of committing secrets&lt;/li&gt;
&lt;li&gt;When to use &lt;code&gt;git merge&lt;/code&gt; vs &lt;code&gt;git rebase&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the practices that transform a personal project into a professional software project.&lt;/p&gt;

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

&lt;p&gt;Imagine you're building a feature for a production application.&lt;/p&gt;

&lt;p&gt;You create a branch, write code, test it, and everything works.&lt;/p&gt;

&lt;p&gt;Should you push directly to &lt;code&gt;main&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;In most professional teams, the answer is &lt;strong&gt;no&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead, your code goes through a review process where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Other developers inspect your changes&lt;/li&gt;
&lt;li&gt;Automated tests run&lt;/li&gt;
&lt;li&gt;Discussions happen around implementation decisions&lt;/li&gt;
&lt;li&gt;Quality checks prevent bugs from reaching production&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That process starts with a &lt;strong&gt;Pull Request&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Pull Requests
&lt;/h2&gt;

&lt;p&gt;A Pull Request (PR) is &lt;strong&gt;not a Git feature&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It is a feature provided by platforms like GitHub, GitLab, and Bitbucket.&lt;/p&gt;

&lt;p&gt;A PR is essentially a request that says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I've completed work on this branch. Please review it and merge it into the target branch."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What a Pull Request Contains
&lt;/h2&gt;

&lt;p&gt;A good PR provides much more than code.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Diff
&lt;/h3&gt;

&lt;p&gt;A visual representation of every change introduced by the branch.&lt;/p&gt;

&lt;p&gt;You'll see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Added lines&lt;/li&gt;
&lt;li&gt;Removed lines&lt;/li&gt;
&lt;li&gt;Modified files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows reviewers to inspect exactly what changed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Description and Context
&lt;/h3&gt;

&lt;p&gt;A PR should explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What changed&lt;/li&gt;
&lt;li&gt;Why it changed&lt;/li&gt;
&lt;li&gt;How it was tested&lt;/li&gt;
&lt;/ul&gt;

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

&lt;blockquote&gt;
&lt;p&gt;The code shows what changed. The PR description explains why it changed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Review Discussion
&lt;/h3&gt;

&lt;p&gt;Reviewers can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comment on specific lines&lt;/li&gt;
&lt;li&gt;Ask questions&lt;/li&gt;
&lt;li&gt;Suggest improvements&lt;/li&gt;
&lt;li&gt;Request changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This creates a permanent record of engineering decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automated Checks
&lt;/h3&gt;

&lt;p&gt;Most modern teams connect CI/CD pipelines to Pull Requests.&lt;/p&gt;

&lt;p&gt;Common checks include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unit tests&lt;/li&gt;
&lt;li&gt;Integration tests&lt;/li&gt;
&lt;li&gt;Linting&lt;/li&gt;
&lt;li&gt;Security scans&lt;/li&gt;
&lt;li&gt;Build verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If these checks fail, the PR usually cannot be merged.&lt;/p&gt;

&lt;h3&gt;
  
  
  Merge Controls
&lt;/h3&gt;

&lt;p&gt;Once reviews are complete and checks pass, the PR can be merged.&lt;/p&gt;

&lt;p&gt;Behind the scenes, the platform performs the merge operation for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Pull Requests Exist
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Quality Control
&lt;/h3&gt;

&lt;p&gt;Fresh eyes catch bugs.&lt;/p&gt;

&lt;p&gt;Reviewers often identify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edge cases&lt;/li&gt;
&lt;li&gt;Logic flaws&lt;/li&gt;
&lt;li&gt;Performance concerns&lt;/li&gt;
&lt;li&gt;Security issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;before users ever encounter them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Knowledge Sharing
&lt;/h3&gt;

&lt;p&gt;Code reviews help teams stay informed about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New features&lt;/li&gt;
&lt;li&gt;Architecture decisions&lt;/li&gt;
&lt;li&gt;Business rules&lt;/li&gt;
&lt;li&gt;Coding standards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reviewing code is one of the fastest ways to learn a codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Historical Context
&lt;/h3&gt;

&lt;p&gt;Months later, someone may ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why was this implemented this way?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The answer often lives in the PR discussion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automation Gateway
&lt;/h3&gt;

&lt;p&gt;PRs provide a natural checkpoint for CI/CD pipelines.&lt;/p&gt;

&lt;p&gt;Before code reaches production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tests run&lt;/li&gt;
&lt;li&gt;Builds run&lt;/li&gt;
&lt;li&gt;Security checks run&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This reduces deployment risk significantly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Pull Request
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Create a Feature Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch &lt;span class="nt"&gt;-c&lt;/span&gt; feature/add-backup-script
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Make Changes and Commit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add backup.sh

git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add automated backup script with cron scheduling"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Push the Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin feature/add-backup-script
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-u&lt;/code&gt; flag links your local branch to the remote branch so future pushes can simply use:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Open the Pull Request
&lt;/h3&gt;

&lt;p&gt;On GitHub:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Compare &amp;amp; Pull Request&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select the target branch (&lt;code&gt;main&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Select your feature branch&lt;/li&gt;
&lt;li&gt;Add a title&lt;/li&gt;
&lt;li&gt;Write a meaningful description&lt;/li&gt;
&lt;li&gt;Submit the PR&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Writing Better PR Descriptions
&lt;/h2&gt;

&lt;p&gt;A strong PR description answers four questions:&lt;/p&gt;

&lt;h3&gt;
  
  
  What changed?
&lt;/h3&gt;

&lt;p&gt;Brief summary of the implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why was it needed?
&lt;/h3&gt;

&lt;p&gt;Business or technical motivation.&lt;/p&gt;

&lt;h3&gt;
  
  
  How was it tested?
&lt;/h3&gt;

&lt;p&gt;Evidence that the change works.&lt;/p&gt;

&lt;h3&gt;
  
  
  What should reviewers focus on?
&lt;/h3&gt;

&lt;p&gt;Any area that may need extra attention.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Reviews: How Professionals Review Code
&lt;/h2&gt;

&lt;p&gt;Code review is not about proving someone wrong.&lt;/p&gt;

&lt;p&gt;It's about improving the software.&lt;/p&gt;

&lt;h3&gt;
  
  
  Focus on the Code, Not the Person
&lt;/h3&gt;

&lt;p&gt;Avoid personal criticism.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You wrote this incorrectly.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This function could be simplified by...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Separate Requirements from Suggestions
&lt;/h3&gt;

&lt;p&gt;Many teams use:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;for non-blocking suggestions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ask Questions
&lt;/h3&gt;

&lt;p&gt;Instead of making assumptions, ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What happens if this input is empty?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Questions encourage discussion and often reveal hidden edge cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Receiving Review Feedback
&lt;/h2&gt;

&lt;p&gt;Every developer receives feedback.&lt;/p&gt;

&lt;p&gt;Good engineers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Respond to comments&lt;/li&gt;
&lt;li&gt;Explain decisions&lt;/li&gt;
&lt;li&gt;Make improvements&lt;/li&gt;
&lt;li&gt;Discuss disagreements respectfully&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code review is a conversation, not a battle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding .gitignore
&lt;/h2&gt;

&lt;p&gt;One of the most important files in any repository is:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This file tells Git:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Never track these files.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why .gitignore Matters
&lt;/h2&gt;

&lt;p&gt;Without it, developers accidentally commit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secrets&lt;/li&gt;
&lt;li&gt;Build artifacts&lt;/li&gt;
&lt;li&gt;Dependency folders&lt;/li&gt;
&lt;li&gt;Personal editor settings&lt;/li&gt;
&lt;li&gt;Operating system files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example .gitignore
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Secrets
*.pem
*.key
.env
id_rsa
id_ed25519

# Logs
*.log
logs/

# Dependencies
node_modules/
__pycache__/
venv/

# IDE Files
.vscode/
.idea/

# Terraform
*.tfstate
*.tfstate.backup
.terraform/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Never Commit Secrets
&lt;/h2&gt;

&lt;p&gt;This is one of the most important rules in software engineering.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Deleting Later Doesn't Work
&lt;/h3&gt;

&lt;p&gt;If a secret appears in Git history, it remains in history even after being removed from later commits.&lt;/p&gt;

&lt;p&gt;Anyone with repository access can still retrieve it.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Happens When Secrets Leak?
&lt;/h3&gt;

&lt;p&gt;Automated bots constantly scan public repositories for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;Database credentials&lt;/li&gt;
&lt;li&gt;AWS access keys&lt;/li&gt;
&lt;li&gt;Tokens&lt;/li&gt;
&lt;li&gt;Private keys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Often within minutes of a push.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prevention Best Practices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create &lt;code&gt;.gitignore&lt;/code&gt; before starting a project&lt;/li&gt;
&lt;li&gt;Use environment variables&lt;/li&gt;
&lt;li&gt;Never hardcode credentials&lt;/li&gt;
&lt;li&gt;Review changes before committing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always run:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;and ideally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--staged&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;before every commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git Rebase: An Alternative to Merge
&lt;/h2&gt;

&lt;p&gt;Most developers learn merging first.&lt;/p&gt;

&lt;p&gt;But Git also provides:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch feature/my-work

git rebase main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This replays your commits on top of the latest version of &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Before Rebase
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main:      A --- B --- C
                         \
feature:                  D --- E
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  After Rebase
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main:      A --- B --- C
                         \
feature:                   D' --- E'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git creates entirely new commits with new hashes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Merge vs Rebase
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Merge&lt;/th&gt;
&lt;th&gt;Rebase&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Preserves exact history&lt;/td&gt;
&lt;td&gt;Creates linear history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Adds merge commits&lt;/td&gt;
&lt;td&gt;Avoids merge commits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safe for shared branches&lt;/td&gt;
&lt;td&gt;Rewrites history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Great for team collaboration&lt;/td&gt;
&lt;td&gt;Great for cleaning personal branches&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The Golden Rule of Rebase
&lt;/h2&gt;

&lt;p&gt;Never rebase a branch that other developers are already using.&lt;/p&gt;

&lt;p&gt;A simple rule:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rebase your own branches. Merge shared branches.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Learning Git commands is only the beginning.&lt;/p&gt;

&lt;p&gt;Professional software development requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pull Requests&lt;/li&gt;
&lt;li&gt;Code Reviews&lt;/li&gt;
&lt;li&gt;Secure Git practices&lt;/li&gt;
&lt;li&gt;Proper &lt;code&gt;.gitignore&lt;/code&gt; usage&lt;/li&gt;
&lt;li&gt;Understanding when to merge and when to rebase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These skills help teams collaborate effectively, maintain quality, and deploy software with confidence.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Great developers don't just write code. They create systems that make collaboration, quality, and safety easier for everyone on the team.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Git Branching &amp; Merging: The Foundation of Team Collaboration in Git</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Thu, 06 Aug 2026 16:57:04 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/git-branching-merging-the-foundation-of-team-collaboration-in-git-388k</link>
      <guid>https://dev.to/themdmohiuddin/git-branching-merging-the-foundation-of-team-collaboration-in-git-388k</guid>
      <description>&lt;p&gt;Git becomes truly powerful when multiple developers can work on different features at the same time without interfering with each other's work. That's exactly what branching and merging solve.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore how Git branches work, how to merge changes safely, resolve conflicts, collaborate through GitHub, and understand the workflow used by modern development teams.&lt;/p&gt;




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

&lt;p&gt;Imagine a team working on a web application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One developer is building a login page.&lt;/li&gt;
&lt;li&gt;Another is fixing a payment bug.&lt;/li&gt;
&lt;li&gt;A third is improving performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If everyone worked directly on the same branch, changes would constantly collide, making development chaotic and risky.&lt;/p&gt;

&lt;p&gt;Git branching allows developers to work independently in isolated environments and merge their changes only when they're ready.&lt;/p&gt;

&lt;p&gt;This is the foundation of modern software collaboration.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Git Branch?
&lt;/h2&gt;

&lt;p&gt;Many beginners think a branch is a complete copy of a project.&lt;/p&gt;

&lt;p&gt;It isn't.&lt;/p&gt;

&lt;p&gt;A Git branch is simply a lightweight pointer to a commit.&lt;/p&gt;

&lt;p&gt;Consider a project history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A --- B --- C
              ^
            main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;main&lt;/code&gt; points to the latest commit (&lt;code&gt;C&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;When you create a new branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A --- B --- C
              ^
            main
              ^
        feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git creates another pointer.&lt;/p&gt;

&lt;p&gt;No files are copied.&lt;/p&gt;

&lt;p&gt;No duplicate project is created.&lt;/p&gt;

&lt;p&gt;Just another reference to the same commit.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Branches Grow
&lt;/h2&gt;

&lt;p&gt;Once you switch to the new branch and start making commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main:    A --- B --- C
                        ^
                      main

feature-login:
                    D --- E
                          ^
                    feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only the feature branch moves forward.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;main&lt;/code&gt; branch remains unchanged.&lt;/p&gt;

&lt;p&gt;This allows you to experiment, develop features, and fix bugs without affecting the stable codebase.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Git Branches Are So Fast
&lt;/h2&gt;

&lt;p&gt;Since a branch is only a pointer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a branch takes milliseconds.&lt;/li&gt;
&lt;li&gt;Switching branches is extremely fast.&lt;/li&gt;
&lt;li&gt;Large repositories don't become slower when creating branches.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike older version control systems where branching was expensive, Git encourages creating branches frequently.&lt;/p&gt;

&lt;p&gt;Creating a branch for every feature or bug fix is considered a best practice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating and Switching Branches
&lt;/h2&gt;

&lt;h3&gt;
  
  
  View Existing Branches
&lt;/h3&gt;



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

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;*&lt;/code&gt; indicates the current branch.&lt;/p&gt;




&lt;h3&gt;
  
  
  Create a New Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the branch but does not switch to it.&lt;/p&gt;




&lt;h3&gt;
  
  
  Switch to a Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Create and Switch in One Command
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch &lt;span class="nt"&gt;-c&lt;/span&gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Older equivalent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Delete a Branch
&lt;/h3&gt;

&lt;p&gt;Safe delete:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Force delete:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-D&lt;/span&gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use force deletion carefully because it can remove unmerged work.&lt;/p&gt;




&lt;h2&gt;
  
  
  Branch Naming Best Practices
&lt;/h2&gt;

&lt;p&gt;Professional teams typically follow naming conventions.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feature/PROJ-123-user-authentication

bugfix/PROJ-456-fix-login-error

hotfix/critical-payment-issue
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;Easy to understand purpose&lt;/li&gt;
&lt;li&gt;Connected to Jira tickets&lt;/li&gt;
&lt;li&gt;Easier code reviews&lt;/li&gt;
&lt;li&gt;Better repository organization&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Understanding Git Merge
&lt;/h2&gt;

&lt;p&gt;Once your work is complete, you'll want to bring it back into &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;First switch to the target branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git now combines both histories.&lt;/p&gt;




&lt;h2&gt;
  
  
  Fast-Forward Merge
&lt;/h2&gt;

&lt;p&gt;This happens when no new commits exist on &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Before merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main:
A --- B --- C

feature:
A --- B --- C --- D --- E
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A --- B --- C --- D --- E
                              ^
                      main &amp;amp; feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git simply moves the &lt;code&gt;main&lt;/code&gt; pointer forward.&lt;/p&gt;

&lt;p&gt;No special merge commit is created.&lt;/p&gt;

&lt;p&gt;This is called a &lt;strong&gt;Fast-Forward Merge&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Three-Way Merge
&lt;/h2&gt;

&lt;p&gt;Real projects usually look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main:
A --- B --- C

feature:
      \
       D --- E
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While you were working, someone else added commits to &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Git must now combine both histories.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A --- B --- C ----------- M
          \             /
           D --- E ----
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;M&lt;/code&gt; is a merge commit.&lt;/p&gt;

&lt;p&gt;It contains two parent commits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One from &lt;code&gt;main&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;One from &lt;code&gt;feature&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process is called a &lt;strong&gt;Three-Way Merge&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Merge Conflict?
&lt;/h2&gt;

&lt;p&gt;Sometimes Git can't determine which change should win.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Main Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Welcome to our application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Feature Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Welcome to our awesome application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both modified the same line.&lt;/p&gt;

&lt;p&gt;Git stops and asks for help.&lt;/p&gt;

&lt;p&gt;This is called a &lt;strong&gt;Merge Conflict&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What a Conflict Looks Like
&lt;/h2&gt;

&lt;p&gt;Git inserts markers directly into the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
Welcome to our application
=======
Welcome to our awesome application
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding the Markers
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;Current branch version.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Separator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Incoming branch version.&lt;/p&gt;




&lt;h2&gt;
  
  
  Resolving Merge Conflicts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Open the File
&lt;/h3&gt;

&lt;p&gt;Review both versions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Decide the Final Content
&lt;/h3&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;Welcome to our awesome application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Remove Conflict Markers
&lt;/h3&gt;

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

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Stage the Resolved File
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add app.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Complete the Merge
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;Git automatically generates a merge message.&lt;/p&gt;




&lt;h2&gt;
  
  
  Don't Fear Merge Conflicts
&lt;/h2&gt;

&lt;p&gt;Many beginners panic when they see conflicts.&lt;/p&gt;

&lt;p&gt;Don't.&lt;/p&gt;

&lt;p&gt;Merge conflicts are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Normal&lt;/li&gt;
&lt;li&gt;Expected&lt;/li&gt;
&lt;li&gt;Common in every team&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even senior engineers resolve conflicts regularly.&lt;/p&gt;

&lt;p&gt;The skill isn't avoiding them.&lt;/p&gt;

&lt;p&gt;The skill is understanding and resolving them confidently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Remote Repositories
&lt;/h2&gt;

&lt;p&gt;Everything so far has been local.&lt;/p&gt;

&lt;p&gt;To collaborate, we use remote repositories hosted on platforms like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub&lt;/li&gt;
&lt;li&gt;GitLab&lt;/li&gt;
&lt;li&gt;Bitbucket&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most common remote name is:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pushing Changes to GitHub
&lt;/h2&gt;

&lt;p&gt;Upload local commits:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sends your local commits to GitHub.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pulling Changes From GitHub
&lt;/h2&gt;

&lt;p&gt;Download and merge changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps your local branch up to date.&lt;/p&gt;




&lt;h2&gt;
  
  
  What &lt;code&gt;git pull&lt;/code&gt; Actually Does
&lt;/h2&gt;

&lt;p&gt;Many developers use &lt;code&gt;git pull&lt;/code&gt; daily without knowing what it really does.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull
=
git fetch
+
git merge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Fetch
&lt;/h3&gt;

&lt;p&gt;Downloads new commits.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;No files are changed.&lt;/p&gt;

&lt;p&gt;No merge occurs.&lt;/p&gt;

&lt;p&gt;Git simply updates its knowledge of the remote repository.&lt;/p&gt;




&lt;h3&gt;
  
  
  Merge
&lt;/h3&gt;

&lt;p&gt;After fetching:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Git combines the changes into your current branch.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Pull Before Push?
&lt;/h2&gt;

&lt;p&gt;Imagine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You create new commits.&lt;/li&gt;
&lt;li&gt;A teammate pushes changes first.&lt;/li&gt;
&lt;li&gt;You try pushing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Git rejects it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;! [rejected] main -&amp;gt; main (fetch first)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git is protecting shared history.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Resolve conflicts if necessary.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Understanding GitHub Flow
&lt;/h2&gt;

&lt;p&gt;GitHub Flow is one of the most widely used collaboration workflows.&lt;/p&gt;

&lt;p&gt;It is simple, lightweight, and works perfectly with CI/CD pipelines.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 1: Create a Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch &lt;span class="nt"&gt;-c&lt;/span&gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 2: Make Commits
&lt;/h3&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;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"feat: add login page"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 3: Push the Branch
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This backs up your work and makes it visible to teammates.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 4: Open a Pull Request (PR)
&lt;/h3&gt;

&lt;p&gt;A Pull Request is a request to merge your branch into &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It allows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discussion&lt;/li&gt;
&lt;li&gt;Review&lt;/li&gt;
&lt;li&gt;Feedback&lt;/li&gt;
&lt;li&gt;Collaboration&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Step 5: Code Review
&lt;/h3&gt;

&lt;p&gt;Teammates review:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code quality&lt;/li&gt;
&lt;li&gt;Architecture&lt;/li&gt;
&lt;li&gt;Bugs&lt;/li&gt;
&lt;li&gt;Security concerns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suggestions are discussed before merging.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 6: Automated Checks Run
&lt;/h3&gt;

&lt;p&gt;Modern CI/CD pipelines automatically run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unit tests&lt;/li&gt;
&lt;li&gt;Linting&lt;/li&gt;
&lt;li&gt;Security scans&lt;/li&gt;
&lt;li&gt;Build verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only passing code can be merged.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 7: Merge Into Main
&lt;/h3&gt;

&lt;p&gt;Once approved:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feature-login → main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The changes become part of the main codebase.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 8: Deploy
&lt;/h3&gt;

&lt;p&gt;Many organizations automatically deploy after merging into &lt;code&gt;main&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Merge → CI/CD Pipeline → Deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 9: Delete the Branch
&lt;/h3&gt;

&lt;p&gt;After merging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The branch has served its purpose.&lt;/p&gt;




&lt;h2&gt;
  
  
  Visualizing GitHub Flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main:
A --- B ----------------------- M
          \                   /
           C --- D --- E ----
                feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create branch&lt;/li&gt;
&lt;li&gt;Commit changes&lt;/li&gt;
&lt;li&gt;Push branch&lt;/li&gt;
&lt;li&gt;Open PR&lt;/li&gt;
&lt;li&gt;Review&lt;/li&gt;
&lt;li&gt;Run automated checks&lt;/li&gt;
&lt;li&gt;Merge&lt;/li&gt;
&lt;li&gt;Deploy&lt;/li&gt;
&lt;li&gt;Delete branch&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Why GitHub Flow Is So Popular
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Simplicity
&lt;/h3&gt;

&lt;p&gt;Only one long-lived branch:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Everything else is temporary.&lt;/p&gt;




&lt;h3&gt;
  
  
  CI/CD Friendly
&lt;/h3&gt;

&lt;p&gt;Every Pull Request becomes a checkpoint for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Security scanning&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Encourages Code Reviews
&lt;/h3&gt;

&lt;p&gt;Changes reach production only after another engineer reviews them.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Quality&lt;/li&gt;
&lt;li&gt;Knowledge sharing&lt;/li&gt;
&lt;li&gt;Team collaboration&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A branch is simply a movable pointer to a commit.&lt;/li&gt;
&lt;li&gt;Branches allow isolated development without affecting main.&lt;/li&gt;
&lt;li&gt;Merging combines work from multiple branches.&lt;/li&gt;
&lt;li&gt;Fast-forward merges occur when histories haven't diverged.&lt;/li&gt;
&lt;li&gt;Three-way merges create a merge commit when histories differ.&lt;/li&gt;
&lt;li&gt;Merge conflicts happen when Git can't decide between overlapping changes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git pull&lt;/code&gt; = &lt;code&gt;git fetch&lt;/code&gt; + &lt;code&gt;git merge&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git push&lt;/code&gt; shares your commits with a remote repository.&lt;/li&gt;
&lt;li&gt;GitHub Flow is the modern workflow used by most teams and integrates naturally with CI/CD.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Master branching and merging, and you've learned the workflow that powers nearly every professional software team in the world.&lt;/p&gt;

&lt;p&gt;Happy Coding! 🚀&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Git Fundamentals: The Foundation of Modern DevOps</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Wed, 05 Aug 2026 15:45:38 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/git-fundamentals-the-foundation-of-modern-devops-525l</link>
      <guid>https://dev.to/themdmohiuddin/git-fundamentals-the-foundation-of-modern-devops-525l</guid>
      <description>&lt;p&gt;From CI/CD pipelines and Infrastructure as Code to Kubernetes deployments and application releases, almost every automation workflow begins with a change in a Git repository. A commit, push, merge, or tag can trigger an entire deployment pipeline automatically.&lt;/p&gt;

&lt;p&gt;Understanding Git isn't just about version control—it's about understanding the foundation that modern software delivery is built on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Git Matters in DevOps
&lt;/h2&gt;

&lt;p&gt;Think about the Software Development Life Cycle (SDLC):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Plan → Code → Build → Test → Release → Deploy → Operate → Monitor&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git sits at the center of this workflow.&lt;/p&gt;

&lt;p&gt;When code changes are committed and pushed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CI/CD pipelines automatically start&lt;/li&gt;
&lt;li&gt;Tests run automatically&lt;/li&gt;
&lt;li&gt;Docker images get built&lt;/li&gt;
&lt;li&gt;Deployments can be triggered&lt;/li&gt;
&lt;li&gt;Infrastructure changes can be tracked&lt;/li&gt;
&lt;li&gt;Teams can collaborate safely&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In many organizations, Git becomes the single source of truth for both application code and infrastructure configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Git?
&lt;/h2&gt;

&lt;p&gt;Git is a &lt;strong&gt;Distributed Version Control System (DVCS)&lt;/strong&gt; that tracks changes to files over time.&lt;/p&gt;

&lt;p&gt;It allows developers to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Track project history&lt;/li&gt;
&lt;li&gt;Revert mistakes&lt;/li&gt;
&lt;li&gt;Collaborate with teams&lt;/li&gt;
&lt;li&gt;Create isolated branches&lt;/li&gt;
&lt;li&gt;Maintain a complete record of changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike older centralized systems, Git is distributed.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Does "Distributed" Mean?
&lt;/h3&gt;

&lt;p&gt;Every copy of a Git repository contains the complete project history.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;You can work offline&lt;/li&gt;
&lt;li&gt;You can create commits without internet access&lt;/li&gt;
&lt;li&gt;Every clone acts as a backup&lt;/li&gt;
&lt;li&gt;There is no single point of failure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you clone a repository, you're not just downloading files—you're downloading the entire project history.&lt;/p&gt;

&lt;p&gt;This is why platforms like GitHub, GitLab, and Bitbucket are not Git itself.&lt;/p&gt;

&lt;p&gt;Git is the version control system.&lt;/p&gt;

&lt;p&gt;GitHub and similar platforms simply provide a shared remote location where teams can collaborate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Git's Snapshot Model
&lt;/h2&gt;

&lt;p&gt;One of the most misunderstood concepts in Git is how it stores history.&lt;/p&gt;

&lt;p&gt;Many beginners assume Git stores only the differences between files.&lt;/p&gt;

&lt;p&gt;That's not how Git works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Git Stores Snapshots
&lt;/h3&gt;

&lt;p&gt;Every commit represents a complete snapshot of the project at a specific moment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Commit A → Commit B → Commit C

Snapshot   Snapshot   Snapshot
of all     of all     of all
files      files      files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Think of each commit as a photograph of your project.&lt;/p&gt;

&lt;p&gt;When you return to a previous commit, Git simply restores that snapshot.&lt;/p&gt;

&lt;p&gt;This design makes operations like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switching branches&lt;/li&gt;
&lt;li&gt;Viewing history&lt;/li&gt;
&lt;li&gt;Restoring previous versions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;extremely fast and efficient.&lt;/p&gt;

&lt;p&gt;Behind the scenes, Git avoids storing duplicate file data when files haven't changed, making storage efficient while maintaining the snapshot model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Three Areas of a Git Project
&lt;/h2&gt;

&lt;p&gt;To understand Git properly, you need to understand its three working areas.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Working Directory
        |
     git add
        ↓
Staging Area
        |
   git commit
        ↓
Repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1. Working Directory
&lt;/h3&gt;

&lt;p&gt;This is where you actively edit files.&lt;/p&gt;

&lt;p&gt;Any changes made here are considered &lt;strong&gt;unstaged changes&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Staging Area
&lt;/h3&gt;

&lt;p&gt;The staging area acts as a preparation zone.&lt;/p&gt;

&lt;p&gt;You decide exactly which changes should be included in the next commit.&lt;/p&gt;

&lt;p&gt;This allows you to create clean and focused commits instead of committing everything at once.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Repository
&lt;/h3&gt;

&lt;p&gt;The repository contains committed snapshots and project history.&lt;/p&gt;

&lt;p&gt;Once changes are committed, they become part of Git's permanent history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Git Repository
&lt;/h2&gt;

&lt;p&gt;To start tracking a project with Git:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This command creates a hidden &lt;code&gt;.git&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.git&lt;/code&gt; folder stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commit history&lt;/li&gt;
&lt;li&gt;Branch information&lt;/li&gt;
&lt;li&gt;Configuration&lt;/li&gt;
&lt;li&gt;Repository metadata&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without the &lt;code&gt;.git&lt;/code&gt; folder, Git history does not exist.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure Your Identity
&lt;/h3&gt;

&lt;p&gt;Git records who created each commit.&lt;/p&gt;

&lt;p&gt;Set your identity once per machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"you@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  git status: Your Most Important Command
&lt;/h2&gt;

&lt;p&gt;If there's one Git command you'll use constantly, it's:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This command tells you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which files have changed&lt;/li&gt;
&lt;li&gt;Which files are staged&lt;/li&gt;
&lt;li&gt;Which files are untracked&lt;/li&gt;
&lt;li&gt;What will happen next&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whenever you're unsure about your repository's state:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;is the first command to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Staging Changes with git add
&lt;/h2&gt;

&lt;p&gt;Before creating a commit, changes must be staged.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage a Single File
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage Multiple Files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add file1.txt file2.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stage Everything
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Interactive Staging
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows you to choose specific portions of a file to stage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Be Careful with git add .
&lt;/h3&gt;

&lt;p&gt;While convenient, &lt;code&gt;git add .&lt;/code&gt; stages everything.&lt;/p&gt;

&lt;p&gt;Always verify what's staged:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;before creating a commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Snapshots with git commit
&lt;/h2&gt;

&lt;p&gt;Once changes are staged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add user authentication endpoint"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a permanent snapshot of the project.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;-m&lt;/code&gt; flag allows you to write the commit message directly in the command.&lt;/p&gt;

&lt;p&gt;Without it, Git opens your default text editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing Better Commit Messages
&lt;/h2&gt;

&lt;p&gt;Good commit messages save time for both you and your team.&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid Messages Like:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fix
update
changes
test
final
final-final
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Prefer Messages Like:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feat: add user authentication endpoint

fix: resolve null pointer exception in payment service

docs: update installation guide

refactor: simplify database connection logic

test: add unit tests for user service

chore: upgrade nginx package version

ci: add GitHub Actions deployment workflow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes history easier to read and understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing Project History with git log
&lt;/h2&gt;

&lt;p&gt;Git provides several ways to inspect history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Full History
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;Displays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commit hash&lt;/li&gt;
&lt;li&gt;Author&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;li&gt;Commit message&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Compact View
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--oneline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;a1b2c3d Add authentication
e4f5g6h Fix API validation
i7j8k9l Initial project setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Visual Branch Graph
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="nt"&gt;--graph&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful when working with multiple branches.&lt;/p&gt;

&lt;h3&gt;
  
  
  Show Actual Code Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays the content changes for each commit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Filter by Author
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--author&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"John"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Filter by File
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--&lt;/span&gt; filename.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shows only commits that modified a specific file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Commit Hashes
&lt;/h2&gt;

&lt;p&gt;Every commit has a unique identifier called a commit hash.&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;a1b2c3d4e5f67890abcdef1234567890
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hash is generated from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commit content&lt;/li&gt;
&lt;li&gt;Metadata&lt;/li&gt;
&lt;li&gt;Parent commit information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even the smallest change creates a completely different hash.&lt;/p&gt;

&lt;p&gt;In practice, you'll usually use only the first few characters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout a1b2c3d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git can usually identify the correct commit from a short unique prefix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;p&gt;Git is much more than a tool for saving code.&lt;/p&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The foundation of CI/CD pipelines&lt;/li&gt;
&lt;li&gt;The source of truth for modern infrastructure&lt;/li&gt;
&lt;li&gt;The backbone of collaborative software development&lt;/li&gt;
&lt;li&gt;The trigger behind most DevOps automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before learning branches, pull requests, Docker, Kubernetes, or Terraform, it's important to understand how Git stores history and manages changes.&lt;/p&gt;

&lt;p&gt;Master these fundamentals, and every DevOps tool that follows will make much more sense.&lt;/p&gt;

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

</description>
      <category>devops</category>
      <category>git</category>
      <category>linux</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Virtualization &amp; Containers — Understanding the Technology That Made Cloud and Docker Possible</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Tue, 04 Aug 2026 16:04:30 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/virtualization-containers-understanding-the-technology-that-made-cloud-and-docker-possible-1h4a</link>
      <guid>https://dev.to/themdmohiuddin/virtualization-containers-understanding-the-technology-that-made-cloud-and-docker-possible-1h4a</guid>
      <description>&lt;p&gt;Before diving into Git, Docker, and Kubernetes, it's worth understanding the technology that made modern cloud computing possible: &lt;strong&gt;Virtualization&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;More importantly, understanding virtualization makes it much easier to understand &lt;strong&gt;why containers became so popular&lt;/strong&gt; and why Docker transformed modern software deployment.&lt;/p&gt;




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

&lt;p&gt;Virtualization sits between traditional infrastructure and modern containerized environments.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Cloud computing wouldn't exist in its current form&lt;/li&gt;
&lt;li&gt;AWS EC2 instances wouldn't be possible&lt;/li&gt;
&lt;li&gt;Running multiple servers on shared hardware would be difficult and expensive&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding virtualization helps answer a fundamental question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why did the industry move from Virtual Machines to Containers?&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is Virtualization?
&lt;/h2&gt;

&lt;p&gt;Virtualization is a technology that allows multiple isolated operating systems to run on a single physical machine.&lt;/p&gt;

&lt;p&gt;Instead of dedicating one physical server to one application, virtualization enables multiple independent systems to share the same hardware resources.&lt;/p&gt;

&lt;p&gt;The virtualization layer abstracts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU&lt;/li&gt;
&lt;li&gt;Memory (RAM)&lt;/li&gt;
&lt;li&gt;Storage&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows several virtual environments to coexist while behaving as separate machines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Before Virtualization
&lt;/h3&gt;

&lt;p&gt;A common approach was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One physical server&lt;/li&gt;
&lt;li&gt;One application&lt;/li&gt;
&lt;li&gt;Large amounts of unused resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Organizations often purchased many servers that spent most of their time underutilized.&lt;/p&gt;

&lt;h3&gt;
  
  
  After Virtualization
&lt;/h3&gt;

&lt;p&gt;One powerful physical machine can host multiple virtual servers, significantly improving hardware utilization and reducing infrastructure costs.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Virtual Machine (VM)?
&lt;/h2&gt;

&lt;p&gt;A Virtual Machine is a complete computer running inside another computer.&lt;/p&gt;

&lt;p&gt;Each VM contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A full operating system&lt;/li&gt;
&lt;li&gt;Its own kernel&lt;/li&gt;
&lt;li&gt;Virtual CPU&lt;/li&gt;
&lt;li&gt;Virtual memory&lt;/li&gt;
&lt;li&gt;Virtual disk&lt;/li&gt;
&lt;li&gt;Applications and services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From the VM's perspective, it believes it's running on actual hardware.&lt;/p&gt;

&lt;p&gt;The layer that creates this illusion is called the &lt;strong&gt;Hypervisor&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Hypervisors
&lt;/h2&gt;

&lt;p&gt;A Hypervisor is responsible for creating, managing, and isolating Virtual Machines.&lt;/p&gt;

&lt;p&gt;It allocates physical resources and ensures one VM cannot interfere with another.&lt;/p&gt;

&lt;h3&gt;
  
  
  Type 1 Hypervisor (Bare Metal)
&lt;/h3&gt;

&lt;p&gt;Runs directly on physical hardware.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────┐ ┌─────────┐ ┌─────────┐
│  VM 1   │ │  VM 2   │ │  VM 3   │
└─────────┘ └─────────┘ └─────────┘
┌─────────────────────────────┐
│      Type 1 Hypervisor      │
└─────────────────────────────┘
┌─────────────────────────────┐
│     Physical Hardware       │
└─────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;VMware ESXi&lt;/li&gt;
&lt;li&gt;Hyper-V&lt;/li&gt;
&lt;li&gt;Xen&lt;/li&gt;
&lt;li&gt;AWS Infrastructure&lt;/li&gt;
&lt;li&gt;Google Cloud Infrastructure&lt;/li&gt;
&lt;li&gt;Azure Infrastructure&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Benefits
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Better performance&lt;/li&gt;
&lt;li&gt;Lower overhead&lt;/li&gt;
&lt;li&gt;Designed for production environments&lt;/li&gt;
&lt;li&gt;Ideal for large-scale cloud platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Type 2 Hypervisor (Hosted)
&lt;/h3&gt;

&lt;p&gt;Runs as an application on top of a host operating system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────┐ ┌─────────┐
│  VM 1   │ │  VM 2   │
└─────────┘ └─────────┘
┌─────────────────────┐
│  Type 2 Hypervisor  │
└─────────────────────┘
┌─────────────────────┐
│      Host OS        │
└─────────────────────┘
┌─────────────────────┐
│ Physical Hardware   │
└─────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;VirtualBox&lt;/li&gt;
&lt;li&gt;VMware Workstation&lt;/li&gt;
&lt;li&gt;VMware Fusion&lt;/li&gt;
&lt;li&gt;Parallels&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Common Use Cases
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Learning environments&lt;/li&gt;
&lt;li&gt;Local development&lt;/li&gt;
&lt;li&gt;Testing different operating systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you've ever run Ubuntu inside VirtualBox, you've already used a Type 2 Hypervisor.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Virtualization Was Revolutionary
&lt;/h2&gt;

&lt;p&gt;Virtualization solved several major infrastructure challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better Resource Utilization
&lt;/h3&gt;

&lt;p&gt;Multiple servers can share the same hardware.&lt;/p&gt;

&lt;h3&gt;
  
  
  Isolation
&lt;/h3&gt;

&lt;p&gt;Problems inside one VM typically don't affect others.&lt;/p&gt;

&lt;h3&gt;
  
  
  Faster Provisioning
&lt;/h3&gt;

&lt;p&gt;Creating a VM takes minutes instead of waiting for new hardware.&lt;/p&gt;

&lt;h3&gt;
  
  
  Snapshots and Rollbacks
&lt;/h3&gt;

&lt;p&gt;Save a VM's state and restore it whenever needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Foundation of Cloud Computing
&lt;/h3&gt;

&lt;p&gt;Virtualization enabled cloud providers to securely offer virtual servers to millions of customers on shared infrastructure.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Limitations of Virtual Machines
&lt;/h2&gt;

&lt;p&gt;Virtual Machines solved many problems, but they introduced new challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Heavy Resource Usage
&lt;/h3&gt;

&lt;p&gt;Every VM requires:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Its own operating system&lt;/li&gt;
&lt;li&gt;Its own kernel&lt;/li&gt;
&lt;li&gt;Background services&lt;/li&gt;
&lt;li&gt;System processes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even before your application starts, significant resources are already consumed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Slower Startup Times
&lt;/h3&gt;

&lt;p&gt;VMs must boot an entire operating system.&lt;/p&gt;

&lt;p&gt;Startup times often range from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;30 seconds&lt;/li&gt;
&lt;li&gt;Several minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Large Images
&lt;/h3&gt;

&lt;p&gt;VM images often measure in gigabytes.&lt;/p&gt;

&lt;p&gt;This makes them slower to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store&lt;/li&gt;
&lt;li&gt;Transfer&lt;/li&gt;
&lt;li&gt;Deploy&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Poor Fit for Microservices
&lt;/h3&gt;

&lt;p&gt;Modern applications frequently consist of dozens of small services.&lt;/p&gt;

&lt;p&gt;Running every service inside its own VM becomes expensive and inefficient.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Containers Changed Everything
&lt;/h2&gt;

&lt;p&gt;Containers solve the same problem as Virtual Machines:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running isolated workloads on shared hardware.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The difference lies in &lt;em&gt;how&lt;/em&gt; isolation is achieved.&lt;/p&gt;

&lt;h3&gt;
  
  
  Virtual Machines
&lt;/h3&gt;

&lt;p&gt;Every VM includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application&lt;/li&gt;
&lt;li&gt;Libraries&lt;/li&gt;
&lt;li&gt;Guest Operating System&lt;/li&gt;
&lt;li&gt;Guest Kernel&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Containers
&lt;/h3&gt;

&lt;p&gt;Containers include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application&lt;/li&gt;
&lt;li&gt;Required Libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But they &lt;strong&gt;share the host operating system kernel&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Virtual Machines Architecture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────┐ ┌─────┐ ┌─────┐
│ App │ │ App │ │ App │
├─────┤ ├─────┤ ├─────┤
│Bins/│ │Bins/│ │Bins/│
│Libs │ │Libs │ │Libs │
├─────┤ ├─────┤ ├─────┤
│Guest│ │Guest│ │Guest│
│ OS  │ │ OS  │ │ OS  │
└─────┘ └─────┘ └─────┘
┌─────────────────────┐
│     Hypervisor      │
└─────────────────────┘
┌─────────────────────┐
│ Physical Hardware   │
└─────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Containers Architecture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────┐ ┌─────┐ ┌─────┐
│ App │ │ App │ │ App │
├─────┤ ├─────┤ ├─────┤
│Bins/│ │Bins/│ │Bins/│
│Libs │ │Libs │ │Libs │
└─────┴─┴─────┴─┴─────┘
┌─────────────────────┐
│  Container Engine   │
│      Docker         │
└─────────────────────┘
┌─────────────────────┐
│  Shared Host Kernel │
└─────────────────────┘
┌─────────────────────┐
│ Physical Hardware   │
└─────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Containers Became So Popular
&lt;/h2&gt;

&lt;p&gt;Because containers share the host kernel, they provide several advantages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Faster Startup
&lt;/h3&gt;

&lt;p&gt;Containers typically start in milliseconds or a few seconds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smaller Images
&lt;/h3&gt;

&lt;p&gt;Container images are often measured in megabytes rather than gigabytes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better Resource Efficiency
&lt;/h3&gt;

&lt;p&gt;No duplicate operating systems consuming RAM and CPU.&lt;/p&gt;

&lt;h3&gt;
  
  
  Higher Density
&lt;/h3&gt;

&lt;p&gt;One server can run dozens or hundreds of containers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Perfect for Microservices
&lt;/h3&gt;

&lt;p&gt;Containers make it easy to package, deploy, and scale individual services independently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Containers vs Virtual Machines
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Virtual Machines&lt;/th&gt;
&lt;th&gt;Containers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Includes Full OS&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Includes Own Kernel&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Startup Speed&lt;/td&gt;
&lt;td&gt;Slower&lt;/td&gt;
&lt;td&gt;Faster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resource Usage&lt;/td&gt;
&lt;td&gt;Higher&lt;/td&gt;
&lt;td&gt;Lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image Size&lt;/td&gt;
&lt;td&gt;Larger&lt;/td&gt;
&lt;td&gt;Smaller&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Isolation&lt;/td&gt;
&lt;td&gt;Stronger&lt;/td&gt;
&lt;td&gt;Lighter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Density Per Server&lt;/td&gt;
&lt;td&gt;Lower&lt;/td&gt;
&lt;td&gt;Higher&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Why Modern Infrastructure Uses Both
&lt;/h2&gt;

&lt;p&gt;In production environments, containers and VMs often work together.&lt;/p&gt;

&lt;p&gt;A common architecture looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Physical Server
       ↓
Virtual Machine
       ↓
Docker Containers
       ↓
Applications
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach combines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VM-level isolation&lt;/li&gt;
&lt;li&gt;Container efficiency&lt;/li&gt;
&lt;li&gt;Better scalability&lt;/li&gt;
&lt;li&gt;Stronger security boundaries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is exactly how many Kubernetes environments run today.&lt;/p&gt;




&lt;h2&gt;
  
  
  Looking Ahead to Docker
&lt;/h2&gt;

&lt;p&gt;The concepts from today directly map to Docker.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Virtualization Concept&lt;/th&gt;
&lt;th&gt;Docker Equivalent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hypervisor&lt;/td&gt;
&lt;td&gt;Container Runtime&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM Image&lt;/td&gt;
&lt;td&gt;Docker Image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Running VM&lt;/td&gt;
&lt;td&gt;Running Container&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Guest OS&lt;/td&gt;
&lt;td&gt;Shared Host Kernel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VirtualBox&lt;/td&gt;
&lt;td&gt;Docker Engine&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Understanding this mapping makes Docker significantly easier to learn.&lt;/p&gt;




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

&lt;p&gt;Virtualization transformed infrastructure by allowing multiple servers to share the same hardware.&lt;/p&gt;

&lt;p&gt;Containers took that idea further by removing the need for a separate operating system in every workload.&lt;/p&gt;

&lt;p&gt;The result was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster deployments&lt;/li&gt;
&lt;li&gt;Lower resource consumption&lt;/li&gt;
&lt;li&gt;Better scalability&lt;/li&gt;
&lt;li&gt;Cloud-native architectures&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tags
&lt;/h2&gt;

&lt;h1&gt;
  
  
  devops #linux #virtualization #containers #docker #cloudcomputing #aws #kubernetes
&lt;/h1&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>virtualization</category>
      <category>cloud</category>
    </item>
    <item>
      <title>🌐 HTTP, HTTPS, Load Balancers &amp; Firewalls: Networking Concepts Every DevOps Engineer Should Know</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Mon, 03 Aug 2026 12:46:47 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/http-https-load-balancers-firewalls-networking-concepts-every-devops-engineer-should-know-31f7</link>
      <guid>https://dev.to/themdmohiuddin/http-https-load-balancers-firewalls-networking-concepts-every-devops-engineer-should-know-31f7</guid>
      <description>&lt;p&gt;Networking doesn't stop at IP addresses, DNS, and ports.&lt;/p&gt;

&lt;p&gt;Once a client successfully reaches a server, several other technologies come into play:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP and HTTPS enable communication between clients and servers&lt;/li&gt;
&lt;li&gt;Load balancers distribute traffic across multiple servers&lt;/li&gt;
&lt;li&gt;Firewalls control who is allowed to access services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These concepts form the foundation of modern web applications, cloud infrastructure, Kubernetes environments, and production systems.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What HTTP is and how it works&lt;/li&gt;
&lt;li&gt;Common HTTP methods and status codes&lt;/li&gt;
&lt;li&gt;How HTTPS secures communication&lt;/li&gt;
&lt;li&gt;Why load balancers are essential&lt;/li&gt;
&lt;li&gt;How firewalls protect infrastructure&lt;/li&gt;
&lt;li&gt;Essential UFW commands for Linux servers&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Is HTTP?
&lt;/h2&gt;

&lt;p&gt;HTTP (HyperText Transfer Protocol) is the communication protocol used by web browsers and servers.&lt;/p&gt;

&lt;p&gt;It follows a simple request-response model:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A client sends a request.&lt;/li&gt;
&lt;li&gt;The server processes the request.&lt;/li&gt;
&lt;li&gt;The server returns a response.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;HTTP is stateless, meaning every request is independent and the server doesn't automatically remember previous requests.&lt;/p&gt;




&lt;h2&gt;
  
  
  Anatomy of an HTTP Request
&lt;/h2&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;GET&lt;/span&gt; &lt;span class="nn"&gt;/search?q=devops&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;www.google.com&lt;/span&gt;
&lt;span class="na"&gt;User-Agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;curl/8.1.2&lt;/span&gt;
&lt;span class="na"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;text/html&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An HTTP request consists of:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Method&lt;/td&gt;
&lt;td&gt;Action to perform&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Path&lt;/td&gt;
&lt;td&gt;Resource being requested&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Version&lt;/td&gt;
&lt;td&gt;HTTP protocol version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Headers&lt;/td&gt;
&lt;td&gt;Metadata about the request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Body&lt;/td&gt;
&lt;td&gt;Optional request data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Anatomy of an HTTP Response
&lt;/h2&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt; &lt;span class="ne"&gt;OK&lt;/span&gt;
&lt;span class="na"&gt;Content-Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;text/html&lt;/span&gt;
&lt;span class="na"&gt;Content-Length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;15258&lt;/span&gt;
&lt;span class="na"&gt;Server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response components:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Status Line&lt;/td&gt;
&lt;td&gt;Status code and message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Headers&lt;/td&gt;
&lt;td&gt;Metadata about the response&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Body&lt;/td&gt;
&lt;td&gt;Actual content returned&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Common HTTP Methods
&lt;/h2&gt;

&lt;p&gt;Different methods tell the server what action to perform.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;Retrieve data&lt;/td&gt;
&lt;td&gt;Load a webpage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;Create new data&lt;/td&gt;
&lt;td&gt;Submit a form&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PUT&lt;/td&gt;
&lt;td&gt;Replace a resource&lt;/td&gt;
&lt;td&gt;Update a profile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PATCH&lt;/td&gt;
&lt;td&gt;Modify part of a resource&lt;/td&gt;
&lt;td&gt;Update an email address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;Remove a resource&lt;/td&gt;
&lt;td&gt;Delete an account&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Understanding HTTP Status Codes
&lt;/h2&gt;

&lt;p&gt;Status codes tell us the result of a request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Status Code Categories
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Range&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1xx&lt;/td&gt;
&lt;td&gt;Informational&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2xx&lt;/td&gt;
&lt;td&gt;Success&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3xx&lt;/td&gt;
&lt;td&gt;Redirection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4xx&lt;/td&gt;
&lt;td&gt;Client Errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5xx&lt;/td&gt;
&lt;td&gt;Server Errors&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Common Status Codes Every DevOps Engineer Should Know
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;OK&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;201&lt;/td&gt;
&lt;td&gt;Created&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;301&lt;/td&gt;
&lt;td&gt;Permanent Redirect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;td&gt;Temporary Redirect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Bad Request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;401&lt;/td&gt;
&lt;td&gt;Unauthorized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;403&lt;/td&gt;
&lt;td&gt;Forbidden&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;td&gt;Not Found&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;429&lt;/td&gt;
&lt;td&gt;Too Many Requests&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;Internal Server Error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;502&lt;/td&gt;
&lt;td&gt;Bad Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;503&lt;/td&gt;
&lt;td&gt;Service Unavailable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;504&lt;/td&gt;
&lt;td&gt;Gateway Timeout&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Why 502, 503, and 504 Matter
&lt;/h3&gt;

&lt;p&gt;These errors often indicate infrastructure issues rather than application bugs.&lt;/p&gt;

&lt;h4&gt;
  
  
  502 Bad Gateway
&lt;/h4&gt;

&lt;p&gt;A proxy or load balancer received an invalid response from the backend service.&lt;/p&gt;

&lt;p&gt;Common cause:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend application crashed&lt;/li&gt;
&lt;li&gt;Service isn't running&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  503 Service Unavailable
&lt;/h4&gt;

&lt;p&gt;The server is temporarily unable to handle requests.&lt;/p&gt;

&lt;p&gt;Common cause:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintenance&lt;/li&gt;
&lt;li&gt;Resource exhaustion&lt;/li&gt;
&lt;li&gt;Overloaded server&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  504 Gateway Timeout
&lt;/h4&gt;

&lt;p&gt;The backend service took too long to respond.&lt;/p&gt;

&lt;p&gt;Common cause:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slow database queries&lt;/li&gt;
&lt;li&gt;Hung application processes&lt;/li&gt;
&lt;li&gt;Network latency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are among the most common production issues DevOps engineers troubleshoot.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is HTTPS?
&lt;/h2&gt;

&lt;p&gt;HTTPS is HTTP running over TLS (Transport Layer Security).&lt;/p&gt;

&lt;p&gt;The communication model remains exactly the same, but all data is encrypted before being transmitted.&lt;/p&gt;

&lt;p&gt;Without HTTPS, attackers could potentially view:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Passwords&lt;/li&gt;
&lt;li&gt;Cookies&lt;/li&gt;
&lt;li&gt;API tokens&lt;/li&gt;
&lt;li&gt;Personal information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HTTPS protects data while it's traveling across networks.&lt;/p&gt;




&lt;h2&gt;
  
  
  How TLS Works
&lt;/h2&gt;

&lt;p&gt;A simplified TLS handshake looks like this:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Client Hello
&lt;/h3&gt;

&lt;p&gt;The client initiates a secure connection request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Server Certificate
&lt;/h3&gt;

&lt;p&gt;The server provides a digital certificate proving its identity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Certificate Validation
&lt;/h3&gt;

&lt;p&gt;The client verifies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Certificate validity&lt;/li&gt;
&lt;li&gt;Domain ownership&lt;/li&gt;
&lt;li&gt;Trusted Certificate Authority (CA)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Key Exchange
&lt;/h3&gt;

&lt;p&gt;Client and server securely establish a shared encryption key.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Encrypted Communication
&lt;/h3&gt;

&lt;p&gt;All subsequent HTTP traffic becomes encrypted.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is an SSL/TLS Certificate?
&lt;/h2&gt;

&lt;p&gt;A certificate binds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A domain name&lt;/li&gt;
&lt;li&gt;A public key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The certificate is digitally signed by a trusted Certificate Authority (CA).&lt;/p&gt;

&lt;p&gt;Popular providers include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let's Encrypt&lt;/li&gt;
&lt;li&gt;DigiCert&lt;/li&gt;
&lt;li&gt;Sectigo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without a valid certificate, browsers display security warnings.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Load Balancer?
&lt;/h2&gt;

&lt;p&gt;A load balancer sits between clients and backend servers.&lt;/p&gt;

&lt;p&gt;Instead of sending all traffic to a single server, it distributes requests across multiple servers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                  ┌──────────────┐
Clients ────────► │ Load Balancer│
                  └──────┬───────┘
                         │
         ┌───────────────┼───────────────┐
         ▼               ▼               ▼

     Server 1       Server 2       Server 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Load Balancers Are Important
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Scalability
&lt;/h3&gt;

&lt;p&gt;Traffic is distributed across multiple servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  High Availability
&lt;/h3&gt;

&lt;p&gt;Failed servers are automatically removed from rotation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zero-Downtime Deployments
&lt;/h3&gt;

&lt;p&gt;Applications can be updated one server at a time without affecting users.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common Load Balancing Algorithms
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Round Robin
&lt;/h3&gt;

&lt;p&gt;Requests are distributed evenly in sequence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request 1 → Server 1
Request 2 → Server 2
Request 3 → Server 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Least Connections
&lt;/h3&gt;

&lt;p&gt;Traffic goes to the server with the fewest active connections.&lt;/p&gt;

&lt;p&gt;Useful when workloads vary significantly.&lt;/p&gt;




&lt;h3&gt;
  
  
  IP Hash
&lt;/h3&gt;

&lt;p&gt;Traffic is routed based on the client's IP address.&lt;/p&gt;

&lt;p&gt;Useful for session persistence.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Firewall?
&lt;/h2&gt;

&lt;p&gt;A firewall controls incoming and outgoing network traffic using predefined rules.&lt;/p&gt;

&lt;p&gt;Its purpose is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow legitimate traffic&lt;/li&gt;
&lt;li&gt;Block unwanted traffic&lt;/li&gt;
&lt;li&gt;Reduce attack surfaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Firewalls can filter traffic based on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ports&lt;/li&gt;
&lt;li&gt;Protocols&lt;/li&gt;
&lt;li&gt;Source IP addresses&lt;/li&gt;
&lt;li&gt;Destination IP addresses&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Default-Deny Security Principle
&lt;/h2&gt;

&lt;p&gt;A strong security practice is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Block Everything
↓
Allow Only What Is Needed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach minimizes exposure and reduces risk.&lt;/p&gt;




&lt;h2&gt;
  
  
  Managing Firewalls with UFW
&lt;/h2&gt;

&lt;p&gt;Ubuntu provides a user-friendly firewall tool called UFW (Uncomplicated Firewall).&lt;/p&gt;

&lt;h3&gt;
  
  
  Check Firewall Status
&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;ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Enable Firewall
&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;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Disable Firewall
&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;ufw disable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Set Default Policies
&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;ufw default deny incoming
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw default allow outgoing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Allow Essential Services
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Allow SSH
&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;ufw allow 22/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Allow HTTP
&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;ufw allow 80/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Allow HTTPS
&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;ufw allow 443/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Allow a Specific IP Address
&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;ufw allow from 203.0.113.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Remove a Firewall Rule
&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;sudo &lt;/span&gt;ufw delete allow 80/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  View Detailed Firewall Rules
&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;sudo &lt;/span&gt;ufw status verbose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Important Warning Before Enabling UFW
&lt;/h2&gt;

&lt;p&gt;If you're connected via SSH, always allow port 22 before enabling the firewall.&lt;/p&gt;

&lt;p&gt;Correct sequence:&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;ufw allow 22/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Failing to do this can lock you out of your server.&lt;/p&gt;




&lt;h2&gt;
  
  
  Security Groups vs UFW
&lt;/h2&gt;

&lt;p&gt;Cloud servers often have two firewall layers:&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud Security Groups
&lt;/h3&gt;

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

&lt;ul&gt;
&lt;li&gt;AWS Security Groups&lt;/li&gt;
&lt;li&gt;Azure NSGs&lt;/li&gt;
&lt;li&gt;GCP Firewall Rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These operate outside the virtual machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  UFW / iptables
&lt;/h3&gt;

&lt;p&gt;These operate inside the Linux operating system.&lt;/p&gt;

&lt;p&gt;Using both provides stronger protection through defense in depth.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bringing It All Together
&lt;/h2&gt;

&lt;p&gt;When you visit a secure website:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;DNS resolves the domain name.&lt;/li&gt;
&lt;li&gt;Your browser connects to the server's IP.&lt;/li&gt;
&lt;li&gt;Traffic is sent through port 443.&lt;/li&gt;
&lt;li&gt;TLS encrypts the connection.&lt;/li&gt;
&lt;li&gt;An HTTP request is sent.&lt;/li&gt;
&lt;li&gt;A load balancer may distribute the request.&lt;/li&gt;
&lt;li&gt;A backend server processes it.&lt;/li&gt;
&lt;li&gt;Firewalls ensure only allowed traffic reaches the service.&lt;/li&gt;
&lt;li&gt;The server returns an HTTP response.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Understanding this flow is essential for anyone working in DevOps, Cloud Engineering, Site Reliability Engineering, or System Administration.&lt;/p&gt;

&lt;p&gt;The deeper you understand networking fundamentals, the easier it becomes to troubleshoot real-world production systems.&lt;/p&gt;

&lt;p&gt;Happy Learning! 🚀&lt;/p&gt;

</description>
      <category>devops</category>
      <category>networking</category>
      <category>webdev</category>
      <category>cloud</category>
    </item>
    <item>
      <title>🌐 Networking Fundamentals Every DevOps Engineer Should Know (IP, DNS &amp; Ports)</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Sun, 02 Aug 2026 08:18:44 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/networking-fundamentals-every-devops-engineer-should-know-ip-dns-ports-407l</link>
      <guid>https://dev.to/themdmohiuddin/networking-fundamentals-every-devops-engineer-should-know-ip-dns-ports-407l</guid>
      <description>&lt;p&gt;If you're learning DevOps, networking is not optional.&lt;/p&gt;

&lt;p&gt;Every SSH connection, web request, Docker container, Kubernetes service, and cloud resource relies on networking behind the scenes.&lt;/p&gt;

&lt;p&gt;When applications fail to communicate, deployments break, or services become unreachable, networking is often the first place engineers investigate.&lt;/p&gt;

&lt;p&gt;In this article, I'll cover:&lt;/p&gt;

&lt;p&gt;✅ What IP addresses are&lt;br&gt;
✅ Public vs Private IPs&lt;br&gt;
✅ Understanding Subnets and CIDR&lt;br&gt;
✅ How DNS works&lt;br&gt;
✅ Common DNS record types&lt;br&gt;
✅ Understanding Ports&lt;br&gt;
✅ The Client-Server Model&lt;br&gt;
✅ Useful networking commands for troubleshooting&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Networking Matters in DevOps
&lt;/h2&gt;

&lt;p&gt;Almost every modern DevOps tool depends on networking.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;SSH connections to servers&lt;/li&gt;
&lt;li&gt;Web applications communicating with databases&lt;/li&gt;
&lt;li&gt;Docker containers talking to each other&lt;/li&gt;
&lt;li&gt;Kubernetes services routing traffic&lt;/li&gt;
&lt;li&gt;CI/CD pipelines deploying applications&lt;/li&gt;
&lt;li&gt;Cloud services communicating across regions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When something stops working, one of the first questions engineers ask is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is this a networking problem?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Understanding networking helps you answer that question quickly.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Is an IP Address?
&lt;/h2&gt;

&lt;p&gt;An IP (Internet Protocol) address is a unique identifier assigned to a device on a network.&lt;/p&gt;

&lt;p&gt;It allows devices to locate and communicate with each other.&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;IPv4 addresses contain four numbers separated by dots.&lt;/p&gt;

&lt;p&gt;Each section ranges from:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Without IP addresses, computers wouldn't know where to send data.&lt;/p&gt;




&lt;h2&gt;
  
  
  Public vs Private IP Addresses
&lt;/h2&gt;

&lt;p&gt;There are two major categories of IP addresses.&lt;/p&gt;

&lt;h3&gt;
  
  
  Public IP
&lt;/h3&gt;

&lt;p&gt;A public IP address is reachable from anywhere on the internet.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Cloud servers&lt;/li&gt;
&lt;li&gt;Public websites&lt;/li&gt;
&lt;li&gt;Home internet routers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your AWS EC2 instance will typically have a public IP so you can SSH into it remotely.&lt;/p&gt;




&lt;h3&gt;
  
  
  Private IP
&lt;/h3&gt;

&lt;p&gt;Private IP addresses are only accessible within a local network.&lt;/p&gt;

&lt;p&gt;Common private ranges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10.0.0.0 – 10.255.255.255

172.16.0.0 – 172.31.255.255

192.168.0.0 – 192.168.255.255
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll frequently encounter these ranges when working with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS VPCs&lt;/li&gt;
&lt;li&gt;Docker networks&lt;/li&gt;
&lt;li&gt;Kubernetes clusters&lt;/li&gt;
&lt;li&gt;Internal company networks&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Localhost (Loopback Address)
&lt;/h2&gt;

&lt;p&gt;A special IP address always refers to the current machine:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;You'll often see:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;which resolves to:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This allows you to test applications running on your own computer without using an external network.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Subnets
&lt;/h2&gt;

&lt;p&gt;As networks grow, they are divided into smaller logical sections called subnets.&lt;/p&gt;

&lt;p&gt;A subnet helps organize devices and control traffic efficiently.&lt;/p&gt;




&lt;h3&gt;
  
  
  CIDR Notation
&lt;/h3&gt;

&lt;p&gt;Subnets are usually written using CIDR notation:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;/24&lt;/code&gt; indicates the network portion of the address.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;/24&lt;/code&gt; subnet provides:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

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

&lt;/div&gt;



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

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

&lt;/div&gt;



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

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;CIDR&lt;/th&gt;
&lt;th&gt;Approx. Addresses&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;/16&lt;/td&gt;
&lt;td&gt;65,536&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/24&lt;/td&gt;
&lt;td&gt;256&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/28&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You'll see CIDR blocks frequently when creating cloud networks and VPCs.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is DNS?
&lt;/h2&gt;

&lt;p&gt;Humans prefer names.&lt;/p&gt;

&lt;p&gt;Computers prefer IP addresses.&lt;/p&gt;

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

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

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

&lt;/div&gt;



&lt;p&gt;becomes something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;142.250.xxx.xxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows your browser to find the correct server.&lt;/p&gt;




&lt;h2&gt;
  
  
  How DNS Resolution Works
&lt;/h2&gt;

&lt;p&gt;When you visit a website:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;the lookup process generally follows these steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your Device
      ↓
DNS Resolver
      ↓
Root Servers
      ↓
TLD Servers (.com)
      ↓
Authoritative DNS Server
      ↓
IP Address Returned
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, your computer connects to the returned IP address.&lt;/p&gt;

&lt;p&gt;This entire process usually takes only milliseconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common DNS Record Types
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Record&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;Domain → IPv4 Address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AAAA&lt;/td&gt;
&lt;td&gt;Domain → IPv6 Address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CNAME&lt;/td&gt;
&lt;td&gt;Domain Alias&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MX&lt;/td&gt;
&lt;td&gt;Mail Server Records&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TXT&lt;/td&gt;
&lt;td&gt;Verification &amp;amp; Security Records&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NS&lt;/td&gt;
&lt;td&gt;Name Server Information&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As a DevOps engineer, you'll regularly manage DNS records when deploying applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Ports
&lt;/h2&gt;

&lt;p&gt;An IP address identifies a machine.&lt;/p&gt;

&lt;p&gt;A port identifies a service running on that machine.&lt;/p&gt;

&lt;p&gt;Think of it like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IP Address = Building Address
Port = Apartment Number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multiple applications can run on the same server because each listens on a different port.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common Ports Every DevOps Engineer Should Know
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Port&lt;/th&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;SSH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;53&lt;/td&gt;
&lt;td&gt;DNS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;td&gt;HTTP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;443&lt;/td&gt;
&lt;td&gt;HTTPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3306&lt;/td&gt;
&lt;td&gt;MySQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5432&lt;/td&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6379&lt;/td&gt;
&lt;td&gt;Redis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;27017&lt;/td&gt;
&lt;td&gt;MongoDB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.10:22
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SSH service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.10:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Web server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.10:443
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Secure website&lt;/p&gt;




&lt;h2&gt;
  
  
  The Client-Server Model
&lt;/h2&gt;

&lt;p&gt;Most applications follow the client-server model.&lt;/p&gt;

&lt;p&gt;A client sends a request.&lt;/p&gt;

&lt;p&gt;A server receives the request and returns a response.&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;CLIENT                     SERVER

Browser  ───── Request ───► Nginx

Browser ◄──── Response ─── Nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;Web browsers&lt;/li&gt;
&lt;li&gt;Mobile apps&lt;/li&gt;
&lt;li&gt;curl&lt;/li&gt;
&lt;li&gt;API consumers&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;Apache&lt;/li&gt;
&lt;li&gt;Node.js applications&lt;/li&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Useful Networking Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ping
&lt;/h3&gt;

&lt;p&gt;Check whether a host is reachable.&lt;br&gt;
&lt;/p&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;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;64 bytes from 142.x.x.x: time=14 ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;Basic connectivity testing&lt;/li&gt;
&lt;li&gt;Measuring latency&lt;/li&gt;
&lt;/ul&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;h3&gt;
  
  
  nslookup
&lt;/h3&gt;

&lt;p&gt;Perform a DNS lookup.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Output shows the IP address associated with the domain.&lt;/p&gt;




&lt;h3&gt;
  
  
  dig
&lt;/h3&gt;

&lt;p&gt;A more advanced DNS troubleshooting tool.&lt;/p&gt;

&lt;p&gt;Basic lookup:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;Lookup MX records:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;View the full DNS resolution path:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;






&lt;h3&gt;
  
  
  curl
&lt;/h3&gt;

&lt;p&gt;Send HTTP requests directly from the terminal.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Show only response headers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://google.com
&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 shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-v&lt;/span&gt; https://google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save output to 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;curl &lt;span class="nt"&gt;-o&lt;/span&gt; page.html https://google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;curl -I&lt;/code&gt; is one of the most useful troubleshooting commands in DevOps.&lt;/p&gt;




&lt;h2&gt;
  
  
  Following the Journey of a Request
&lt;/h2&gt;

&lt;p&gt;Let's see what happens when you run:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Step-by-step:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;DNS resolves &lt;code&gt;google.com&lt;/code&gt; to an IP address.&lt;/li&gt;
&lt;li&gt;Your machine connects to that IP.&lt;/li&gt;
&lt;li&gt;It uses port &lt;code&gt;443&lt;/code&gt; for HTTPS.&lt;/li&gt;
&lt;li&gt;A secure TLS connection is established.&lt;/li&gt;
&lt;li&gt;The HTTP request is sent.&lt;/li&gt;
&lt;li&gt;Google's server processes the request.&lt;/li&gt;
&lt;li&gt;An HTTP response is returned.&lt;/li&gt;
&lt;li&gt;curl displays the result.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DNS
 ↓
IP Address
 ↓
Port 443
 ↓
TLS Handshake
 ↓
HTTP Request
 ↓
HTTP Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This flow is the foundation of nearly every web application you'll work with.&lt;/p&gt;




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

&lt;p&gt;Networking is one of the most important skills in DevOps.&lt;/p&gt;

&lt;p&gt;Understanding IP addresses, DNS, ports, and client-server communication gives you the foundation needed for cloud computing, Docker, Kubernetes, load balancers, CI/CD pipelines, and modern infrastructure.&lt;/p&gt;

&lt;p&gt;The better you understand how systems communicate, the easier it becomes to troubleshoot real-world production issues.&lt;/p&gt;

&lt;p&gt;If you have favorite networking commands or troubleshooting tips, feel free to share them in the comments.&lt;/p&gt;

&lt;p&gt;Happy Learning! 🌐🚀&lt;/p&gt;

</description>
      <category>devops</category>
      <category>infrastructure</category>
      <category>networking</category>
    </item>
    <item>
      <title>📦 Linux Package Management for DevOps Engineers: A Practical Guide</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Sat, 01 Aug 2026 08:29:49 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/linux-package-management-for-devops-engineers-a-practical-guide-2m6i</link>
      <guid>https://dev.to/themdmohiuddin/linux-package-management-for-devops-engineers-a-practical-guide-2m6i</guid>
      <description>&lt;p&gt;Every server, virtual machine, and container starts with a simple requirement: software needs to be installed.&lt;/p&gt;

&lt;p&gt;Whether you're setting up a web server, deploying a database, configuring monitoring tools, or preparing a Docker image, package managers are the tools that make software installation fast, reliable, and repeatable.&lt;/p&gt;

&lt;p&gt;As part of my DevOps learning journey, I explored how Linux package managers work, why they matter in modern infrastructure, and how they help automate software provisioning.&lt;/p&gt;

&lt;p&gt;In this article, I'll cover:&lt;/p&gt;

&lt;p&gt;✅ What package managers are&lt;br&gt;
✅ Why package management matters in DevOps&lt;br&gt;
✅ Using &lt;code&gt;apt&lt;/code&gt; on Ubuntu&lt;br&gt;
✅ Understanding repositories and dependencies&lt;br&gt;
✅ &lt;code&gt;yum&lt;/code&gt; and &lt;code&gt;dnf&lt;/code&gt; basics&lt;br&gt;
✅ Why minimal server images are preferred&lt;br&gt;
✅ A real-world software installation workflow&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Package Managers Matter in DevOps
&lt;/h2&gt;

&lt;p&gt;Imagine installing software manually on every server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download source code&lt;/li&gt;
&lt;li&gt;Install dependencies one by one&lt;/li&gt;
&lt;li&gt;Compile the application&lt;/li&gt;
&lt;li&gt;Configure everything manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not only would this take time, but it would also be difficult to reproduce consistently.&lt;/p&gt;

&lt;p&gt;Package managers solve this problem by allowing you to install, update, and remove software using simple commands.&lt;/p&gt;

&lt;p&gt;This becomes especially important in DevOps because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dockerfiles use package managers to install software&lt;/li&gt;
&lt;li&gt;Configuration management tools like Ansible rely on package managers&lt;/li&gt;
&lt;li&gt;Cloud servers start with minimal operating systems&lt;/li&gt;
&lt;li&gt;Infrastructure should be repeatable and automated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Package managers are one of the foundations of modern infrastructure automation.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Is a Package Manager?
&lt;/h2&gt;

&lt;p&gt;A package manager is a tool that installs and manages software packages on a Linux system.&lt;/p&gt;

&lt;p&gt;A package typically contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Application files&lt;/li&gt;
&lt;li&gt;Dependencies&lt;/li&gt;
&lt;li&gt;Configuration information&lt;/li&gt;
&lt;li&gt;Installation instructions&lt;/li&gt;
&lt;li&gt;Metadata&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Package managers handle several important tasks automatically.&lt;/p&gt;
&lt;h3&gt;
  
  
  Dependency Resolution
&lt;/h3&gt;

&lt;p&gt;If Software A requires Libraries B and C, the package manager installs them automatically.&lt;/p&gt;

&lt;p&gt;You don't need to manually track every dependency.&lt;/p&gt;
&lt;h3&gt;
  
  
  Software Repositories
&lt;/h3&gt;

&lt;p&gt;Package managers download software from trusted repositories maintained by operating system vendors or software providers.&lt;/p&gt;
&lt;h3&gt;
  
  
  Correct File Placement
&lt;/h3&gt;

&lt;p&gt;Installed files are placed in the proper Linux directories automatically.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/bin   → Executables
/etc       → Configuration files
/usr/lib   → Libraries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Version Tracking
&lt;/h3&gt;

&lt;p&gt;Package managers keep track of installed software, making updates and removals much easier.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding apt (Ubuntu Package Manager)
&lt;/h2&gt;

&lt;p&gt;Since Ubuntu is one of the most popular Linux distributions in cloud environments, &lt;code&gt;apt&lt;/code&gt; is a command you'll use frequently.&lt;/p&gt;




&lt;h3&gt;
  
  
  Refresh Package Information
&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 update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command updates the local package catalog.&lt;/p&gt;

&lt;p&gt;It does &lt;strong&gt;not&lt;/strong&gt; install or upgrade software.&lt;/p&gt;

&lt;p&gt;Think of it as refreshing a store's inventory before shopping.&lt;/p&gt;




&lt;h3&gt;
  
  
  Upgrade Installed Packages
&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 upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This upgrades installed packages to newer available versions.&lt;/p&gt;




&lt;h3&gt;
  
  
  Install Software
&lt;/h3&gt;

&lt;p&gt;Install Nginx:&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install multiple packages:&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 docker.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Remove Software
&lt;/h3&gt;

&lt;p&gt;Remove a package:&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove a package and its configuration 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;sudo &lt;/span&gt;apt purge nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Clean Unused Dependencies
&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 autoremove
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes packages that are no longer required.&lt;/p&gt;




&lt;h3&gt;
  
  
  Search for Packages
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;p&gt;View package details:&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  List Installed Packages
&lt;/h3&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful when auditing a server.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where Does apt Get Packages?
&lt;/h2&gt;

&lt;p&gt;Package repositories are configured in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/apt/sources.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/etc/apt/sources.list.d/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These files contain repository URLs where Ubuntu downloads software packages.&lt;/p&gt;

&lt;p&gt;Most installations use Ubuntu's official repositories, but third-party repositories can also be added when necessary.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding yum and dnf
&lt;/h2&gt;

&lt;p&gt;While Ubuntu uses &lt;code&gt;apt&lt;/code&gt;, Red Hat-based distributions use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;yum&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dnf&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You'll encounter these when working with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Red Hat Enterprise Linux (RHEL)&lt;/li&gt;
&lt;li&gt;CentOS&lt;/li&gt;
&lt;li&gt;Fedora&lt;/li&gt;
&lt;li&gt;Amazon Linux&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Common Command Equivalents
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Ubuntu (apt)&lt;/th&gt;
&lt;th&gt;RHEL/Fedora (dnf)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Update package info&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apt update&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dnf check-update&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Install package&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apt install nginx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dnf install nginx&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remove package&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apt remove nginx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dnf remove nginx&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Upgrade packages&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apt upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dnf upgrade&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Search packages&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apt search nginx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dnf search nginx&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Package details&lt;/td&gt;
&lt;td&gt;&lt;code&gt;apt show nginx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dnf info nginx&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The concepts remain the same regardless of the distribution.&lt;/p&gt;

&lt;p&gt;Only the commands change.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Minimal Server Images Matter
&lt;/h2&gt;

&lt;p&gt;Modern DevOps practices encourage using minimal operating system images.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;h3&gt;
  
  
  Improved Security
&lt;/h3&gt;

&lt;p&gt;Every installed package increases the attack surface.&lt;/p&gt;

&lt;p&gt;Less software means fewer vulnerabilities to patch and monitor.&lt;/p&gt;




&lt;h3&gt;
  
  
  Faster Provisioning
&lt;/h3&gt;

&lt;p&gt;Smaller images:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download faster&lt;/li&gt;
&lt;li&gt;Boot faster&lt;/li&gt;
&lt;li&gt;Deploy faster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This becomes extremely important when working with containers.&lt;/p&gt;




&lt;h3&gt;
  
  
  Easier Maintenance
&lt;/h3&gt;

&lt;p&gt;A minimal system contains only what your application needs.&lt;/p&gt;

&lt;p&gt;This makes troubleshooting and auditing much simpler.&lt;/p&gt;




&lt;h3&gt;
  
  
  Reduced Resource Usage
&lt;/h3&gt;

&lt;p&gt;Unused software consumes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disk space&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;CPU resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Minimal systems avoid unnecessary overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Real-World Installation Workflow
&lt;/h2&gt;

&lt;p&gt;Let's walk through a practical example using Nginx.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Update Package Information
&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 update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 2: Install Nginx
&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;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-y&lt;/code&gt; flag automatically confirms installation prompts.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 3: Verify Service Status
&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;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Step 4: Start and Enable Nginx
&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;systemctl start nginx
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures Nginx starts automatically after server reboots.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 5: Verify Listening Ports
&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;ss &lt;span class="nt"&gt;-tulpn&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; :80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This confirms Nginx is listening on port 80.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 6: Check Logs
&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/nginx/error.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If something goes wrong, logs are usually the first place to investigate.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Command Reference
&lt;/h2&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;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt update&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Refresh package catalog&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Upgrade installed packages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt install&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Install software&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt remove&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove software&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt purge&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove software and configs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt autoremove&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove unused dependencies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt search&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Search available packages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt show&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View package details&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt list --installed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List installed software&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dnf install&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Install packages on RHEL/Fedora&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;systemctl status&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Verify service status&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;Package managers are one of the most important tools in a DevOps engineer's toolkit.&lt;/p&gt;

&lt;p&gt;They simplify software installation, automate dependency management, improve consistency, and make infrastructure easier to maintain.&lt;/p&gt;

&lt;p&gt;Whether you're provisioning cloud servers, building Docker images, writing Ansible playbooks, or managing production environments, package management is a skill you'll use almost every day.&lt;/p&gt;

&lt;p&gt;Understanding how package managers work today will make containerization, automation, and infrastructure management much easier as you continue your DevOps journey.&lt;/p&gt;

&lt;p&gt;I'm documenting my DevOps learning journey and sharing beginner-friendly notes as I learn.&lt;/p&gt;

&lt;p&gt;What package manager do you use most often—&lt;code&gt;apt&lt;/code&gt;, &lt;code&gt;dnf&lt;/code&gt;, &lt;code&gt;yum&lt;/code&gt;, or something else?&lt;/p&gt;

&lt;p&gt;Happy Learning! 🚀🐧&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>ubuntu</category>
      <category>beginners</category>
    </item>
    <item>
      <title>📝 Bash Scripting Basics Every DevOps Engineer Should Know</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Fri, 31 Jul 2026 15:58:53 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/bash-scripting-basics-every-devops-engineer-should-know-4feo</link>
      <guid>https://dev.to/themdmohiuddin/bash-scripting-basics-every-devops-engineer-should-know-4feo</guid>
      <description>&lt;p&gt;If you're learning DevOps, Linux, or Cloud Computing, Bash scripting is one of the most valuable skills you can develop.&lt;/p&gt;

&lt;p&gt;Up until now, you've probably been running Linux commands one by one in the terminal. But in real-world DevOps, repeating the same commands manually isn't efficient. Instead, we automate those tasks using shell scripts.&lt;/p&gt;

&lt;p&gt;Whether you're deploying applications, monitoring servers, creating backups, or scheduling maintenance jobs, Bash scripting is often the first step toward automation.&lt;/p&gt;

&lt;p&gt;In this article, I'll cover:&lt;/p&gt;

&lt;p&gt;✅ Why Bash scripting matters&lt;br&gt;
✅ Terminal text editors (Nano &amp;amp; Vim)&lt;br&gt;
✅ Creating your first Bash script&lt;br&gt;
✅ Variables and special variables&lt;br&gt;
✅ Conditionals (&lt;code&gt;if&lt;/code&gt;, &lt;code&gt;else&lt;/code&gt;)&lt;br&gt;
✅ Loops (&lt;code&gt;for&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt;)&lt;br&gt;
✅ Functions&lt;br&gt;
✅ Automating tasks with Cron&lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Bash Scripting Matters
&lt;/h2&gt;

&lt;p&gt;Imagine typing the same five commands every day to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deploy an application&lt;/li&gt;
&lt;li&gt;Back up a database&lt;/li&gt;
&lt;li&gt;Restart a service&lt;/li&gt;
&lt;li&gt;Clean old log files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of repeating these commands manually, you can place them inside a script and execute them with a single command.&lt;/p&gt;

&lt;p&gt;That's automation.&lt;/p&gt;

&lt;p&gt;In fact, Bash scripting is the foundation of many DevOps tools. Before Jenkins pipelines, Ansible playbooks, or Terraform modules execute tasks, they're often running shell commands behind the scenes.&lt;/p&gt;

&lt;p&gt;Learning Bash means learning how automation actually works.&lt;/p&gt;


&lt;h2&gt;
  
  
  Terminal Text Editors
&lt;/h2&gt;

&lt;p&gt;When working on remote Linux servers through SSH, you usually won't have a graphical editor like VS Code.&lt;/p&gt;

&lt;p&gt;Instead, you'll use terminal-based editors.&lt;/p&gt;

&lt;p&gt;The two most common are &lt;strong&gt;Nano&lt;/strong&gt; and &lt;strong&gt;Vim&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Nano
&lt;/h3&gt;

&lt;p&gt;Nano is beginner-friendly and easy to use.&lt;/p&gt;

&lt;p&gt;Open 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;nano script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shortcut&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl + O&lt;/td&gt;
&lt;td&gt;Save&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl + X&lt;/td&gt;
&lt;td&gt;Exit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl + K&lt;/td&gt;
&lt;td&gt;Cut a line&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl + U&lt;/td&gt;
&lt;td&gt;Paste&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ctrl + W&lt;/td&gt;
&lt;td&gt;Search&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Nano displays these shortcuts at the bottom of the screen, making it easy for beginners.&lt;/p&gt;




&lt;h3&gt;
  
  
  Vim
&lt;/h3&gt;

&lt;p&gt;Vim is one of the most powerful text editors available on Linux.&lt;/p&gt;

&lt;p&gt;Open 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;vim script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike Nano, Vim uses different modes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Normal&lt;/td&gt;
&lt;td&gt;Execute commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insert&lt;/td&gt;
&lt;td&gt;Type text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command&lt;/td&gt;
&lt;td&gt;Save, quit, search&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Essential Vim commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;i      → Enter Insert mode
Esc    → Return to Normal mode
:w     → Save
:q     → Quit
:wq    → Save and Quit
:q!    → Quit without saving
dd     → Delete current line
/text  → Search for text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While Vim has a learning curve, it's installed on almost every Linux system, making it a valuable tool to know.&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating Your First Bash Script
&lt;/h2&gt;

&lt;p&gt;A Bash script is simply a text file containing Linux commands.&lt;/p&gt;

&lt;p&gt;Every script should begin with a &lt;strong&gt;shebang&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;#!/bin/bash&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The shebang tells Linux which interpreter should execute the script.&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="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello DevOps!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make it executable:&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;chmod&lt;/span&gt; +x hello.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./hello.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also execute it without making it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash hello.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Working with Variables
&lt;/h2&gt;

&lt;p&gt;Variables store values that can be reused throughout a script.&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="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"DevOps Engineer"&lt;/span&gt;
&lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Count: &lt;/span&gt;&lt;span class="nv"&gt;$count&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Important Rules
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No spaces around &lt;code&gt;=&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;$&lt;/code&gt; when accessing a variable&lt;/li&gt;
&lt;li&gt;Wrap variables inside double quotes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Correct:&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="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"John"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"John"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Command Substitution
&lt;/h2&gt;

&lt;p&gt;Store command output inside a variable.&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="nv"&gt;current_date&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$current_date&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another 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="nv"&gt;file_count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file_count&lt;/span&gt;&lt;span class="s2"&gt; files found."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This technique is commonly used in automation scripts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Special Variables
&lt;/h2&gt;

&lt;p&gt;Bash provides several built-in variables.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Script name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;First argument&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Second argument&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$#&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Number of arguments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$?&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Exit status of previous command&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&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;./deploy.sh production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the script:&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;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Using Conditionals
&lt;/h2&gt;

&lt;p&gt;Conditionals allow scripts to make decisions.&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="nv"&gt;disk_usage&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;85

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$disk_usage&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-gt&lt;/span&gt; 80 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Disk usage is high!"&lt;/span&gt;
&lt;span class="k"&gt;else
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Disk usage is healthy."&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Common Comparison Operators
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-eq&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Equal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-ne&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Not equal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-gt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Greater than&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-lt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Less than&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-ge&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Greater than or equal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-le&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Less than or equal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;==&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;String equality&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;!=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;String inequality&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-f&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;File exists&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-d&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Directory exists&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Checking Whether a File Exists
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="s2"&gt;"app.log"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Log file found."&lt;/span&gt;
&lt;span class="k"&gt;else
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Log file missing."&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a common pattern in deployment and monitoring scripts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Using Loops
&lt;/h2&gt;

&lt;p&gt;Loops execute commands repeatedly.&lt;/p&gt;

&lt;h3&gt;
  
  
  For Loop
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;server &lt;span class="k"&gt;in &lt;/span&gt;web1 web2 web3
&lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Deploying to &lt;/span&gt;&lt;span class="nv"&gt;$server&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Loop through 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="k"&gt;for &lt;/span&gt;file &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;.log
&lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Loop over numbers:&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="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;1..5&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  While Loop
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$count&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-le&lt;/span&gt; 5 &lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$count&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;count+1&lt;span class="k"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Real Example: Retry Until Success
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;attempt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$attempt&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-lt&lt;/span&gt; 5 &lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;do
    if &lt;/span&gt;curl &lt;span class="nt"&gt;-sf&lt;/span&gt; http://localhost:8080/health
    &lt;span class="k"&gt;then
        &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Service is running."&lt;/span&gt;
        &lt;span class="nb"&gt;break
    &lt;/span&gt;&lt;span class="k"&gt;fi

    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Retrying..."&lt;/span&gt;

    &lt;span class="nv"&gt;attempt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;attempt+1&lt;span class="k"&gt;))&lt;/span&gt;

    &lt;span class="nb"&gt;sleep &lt;/span&gt;5
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pattern is widely used in deployment scripts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating Functions
&lt;/h2&gt;

&lt;p&gt;Functions help organize larger scripts.&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;log_message&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;message&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Call the function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;log_message &lt;span class="s2"&gt;"Deployment started"&lt;/span&gt;

log_message &lt;span class="s2"&gt;"Deployment completed"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using functions makes scripts easier to read and maintain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Automating Tasks with Cron
&lt;/h2&gt;

&lt;p&gt;Automation becomes even more powerful when scripts run automatically.&lt;/p&gt;

&lt;p&gt;Linux provides &lt;strong&gt;cron&lt;/strong&gt; for scheduling tasks.&lt;/p&gt;

&lt;p&gt;Edit your cron jobs:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Cron format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* * * * * command
│ │ │ │ │
│ │ │ │ └── Day of Week
│ │ │ └──── Month
│ │ └────── Day of Month
│ └──────── Hour
└────────── Minute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Common Cron Examples
&lt;/h3&gt;

&lt;p&gt;Run every day at 2:30 AM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;30 2 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; /home/user/backup.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run every hour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; /home/user/health-check.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run every Monday at 9 AM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;0 9 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; 1 /home/user/report.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run every five minutes:&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="k"&gt;*&lt;/span&gt;/5 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; /home/user/monitor.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Logging Cron Output
&lt;/h2&gt;

&lt;p&gt;Always redirect cron output to a log file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;30 2 &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt; /home/user/backup.sh &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /home/user/backup.log 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This captures both:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Standard output&lt;/li&gt;
&lt;li&gt;Error messages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Making troubleshooting much easier.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Practices for Bash Scripts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Start every script with &lt;code&gt;#!/bin/bash&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use meaningful variable names&lt;/li&gt;
&lt;li&gt;Always quote variables&lt;/li&gt;
&lt;li&gt;Use functions for reusable logic&lt;/li&gt;
&lt;li&gt;Test scripts before running them in production&lt;/li&gt;
&lt;li&gt;Use absolute paths in cron jobs&lt;/li&gt;
&lt;li&gt;Log script output for easier debugging&lt;/li&gt;
&lt;li&gt;Add comments to improve readability&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick Command Reference
&lt;/h2&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;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nano file.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open file in Nano&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vim file.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open file in Vim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;chmod +x file.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Make script executable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;./file.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run script&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bash file.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Execute with Bash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;crontab -e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Edit cron jobs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Current date and time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$(command)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Command substitution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$?&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Previous command exit status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$#&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Number of arguments&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;Bash scripting is where Linux commands become automation.&lt;/p&gt;

&lt;p&gt;By learning how to write scripts, use variables, create loops, organize code with functions, and schedule jobs with Cron, you're building the foundation for more advanced DevOps tools like Jenkins, Ansible, Terraform, and Kubernetes.&lt;/p&gt;

&lt;p&gt;These concepts may seem simple now, but they're used every day in real production environments.&lt;/p&gt;

&lt;p&gt;If you have any Bash scripting tips or favorite automation tricks, feel free to share them in the comments.&lt;/p&gt;

&lt;p&gt;Happy Learning! 🐧🚀&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>🔐 SSH Essentials Every DevOps Engineer Should Know</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Thu, 30 Jul 2026 17:35:22 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/ssh-essentials-every-devops-engineer-should-know-2k5n</link>
      <guid>https://dev.to/themdmohiuddin/ssh-essentials-every-devops-engineer-should-know-2k5n</guid>
      <description>&lt;p&gt;If you're learning DevOps, Cloud Computing, or System Administration, SSH is one of the most important skills you'll ever learn.&lt;/p&gt;

&lt;p&gt;Almost every cloud server, Kubernetes node, CI/CD runner, and Linux machine is managed remotely through SSH. Without SSH, you simply can't access or manage production infrastructure effectively.&lt;/p&gt;

&lt;p&gt;As part of my DevOps learning journey, I spent time understanding how SSH works, how key-based authentication improves security, and how to securely connect to remote servers.&lt;/p&gt;

&lt;p&gt;In this article, I'll cover:&lt;/p&gt;

&lt;p&gt;✅ What SSH is&lt;br&gt;
✅ How SSH works&lt;br&gt;
✅ Public vs Private Keys&lt;br&gt;
✅ Generating SSH keys&lt;br&gt;
✅ Connecting to remote servers&lt;br&gt;
✅ Managing SSH configurations&lt;br&gt;
✅ Secure file transfers with SCP&lt;/p&gt;

&lt;p&gt;Let's get started.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Is SSH?
&lt;/h2&gt;

&lt;p&gt;SSH (Secure Shell) is a secure network protocol that allows you to remotely access and manage another computer over a network.&lt;/p&gt;

&lt;p&gt;Using SSH, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access a remote Linux server&lt;/li&gt;
&lt;li&gt;Execute commands remotely&lt;/li&gt;
&lt;li&gt;Manage cloud infrastructure&lt;/li&gt;
&lt;li&gt;Transfer files securely&lt;/li&gt;
&lt;li&gt;Automate deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before SSH existed, tools like Telnet sent everything in plain text, including passwords.&lt;/p&gt;

&lt;p&gt;SSH solved this problem by encrypting all communication between your computer and the remote server.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why SSH Is Important for DevOps
&lt;/h2&gt;

&lt;p&gt;Every modern DevOps workflow relies on SSH.&lt;/p&gt;

&lt;p&gt;Some common examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connecting to AWS EC2 instances&lt;/li&gt;
&lt;li&gt;Managing Linux servers&lt;/li&gt;
&lt;li&gt;Accessing Kubernetes nodes&lt;/li&gt;
&lt;li&gt;Deploying applications&lt;/li&gt;
&lt;li&gt;Running automation scripts&lt;/li&gt;
&lt;li&gt;Configuring CI/CD pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In real-world DevOps work, you'll frequently need to answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is the server running properly?&lt;/li&gt;
&lt;li&gt;Why is my application failing?&lt;/li&gt;
&lt;li&gt;How do I deploy new code?&lt;/li&gt;
&lt;li&gt;How can I transfer files securely?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SSH is usually the first tool you'll use to solve these problems.&lt;/p&gt;


&lt;h2&gt;
  
  
  How SSH Works
&lt;/h2&gt;

&lt;p&gt;SSH works using encryption and authentication.&lt;/p&gt;

&lt;p&gt;A typical SSH connection happens in two stages.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: Server Verification
&lt;/h3&gt;

&lt;p&gt;When connecting to a server for the first time, SSH verifies the server's identity.&lt;/p&gt;

&lt;p&gt;You may see a message like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The authenticity of host '203.0.113.5' can't be established.
ED25519 key fingerprint is SHA256:xxxxxx.
Are you sure you want to continue connecting (yes/no)?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you trust the server, type:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;SSH then stores the server fingerprint locally in:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Future connections are checked against this fingerprint automatically.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 2: Authentication
&lt;/h3&gt;

&lt;p&gt;After the encrypted channel is established, SSH verifies who you are.&lt;/p&gt;

&lt;p&gt;There are two common methods.&lt;/p&gt;

&lt;h4&gt;
  
  
  Password Authentication
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client → Password → Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The password travels through the encrypted connection.&lt;/p&gt;

&lt;p&gt;While secure, passwords can still be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Guessed&lt;/li&gt;
&lt;li&gt;Reused&lt;/li&gt;
&lt;li&gt;Phished&lt;/li&gt;
&lt;li&gt;Brute-forced&lt;/li&gt;
&lt;/ul&gt;




&lt;h4&gt;
  
  
  Key-Based Authentication
&lt;/h4&gt;

&lt;p&gt;This is the industry standard.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;A private key&lt;/li&gt;
&lt;li&gt;A public key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The public key is stored on the server.&lt;/p&gt;

&lt;p&gt;The private key remains on your computer.&lt;/p&gt;

&lt;p&gt;When connecting, SSH verifies that you own the matching private key without ever sending it across the network.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Stronger security&lt;/li&gt;
&lt;li&gt;No password typing&lt;/li&gt;
&lt;li&gt;Resistant to brute-force attacks&lt;/li&gt;
&lt;li&gt;Easy automation for CI/CD pipelines&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Generating an SSH Key Pair
&lt;/h2&gt;

&lt;p&gt;Create a new SSH key using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding the Options
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-t ed25519&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Modern and secure key type&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-C&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Comment to identify the key&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;You'll be prompted for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File location&lt;/li&gt;
&lt;li&gt;Passphrase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Press Enter to accept the default location.&lt;/p&gt;




&lt;h3&gt;
  
  
  Generated Files
&lt;/h3&gt;

&lt;p&gt;View your SSH 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;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id_ed25519
id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;id_ed25519&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Private key (secret)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;id_ed25519.pub&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Public key (safe to share)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Important Security Rule
&lt;/h3&gt;

&lt;p&gt;Never share:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Never commit it to GitHub.&lt;/p&gt;

&lt;p&gt;Never send it through email or chat.&lt;/p&gt;

&lt;p&gt;Only share:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.pub&lt;/code&gt; file is designed to be distributed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Public and Private Keys
&lt;/h2&gt;

&lt;p&gt;Think of it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Public Key  → Lock
Private Key → Key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can give your lock to anyone.&lt;/p&gt;

&lt;p&gt;Only the person holding the matching key can unlock it.&lt;/p&gt;

&lt;p&gt;This is essentially how SSH authentication works.&lt;/p&gt;




&lt;h2&gt;
  
  
  Adding Your Public Key to a Server
&lt;/h2&gt;

&lt;p&gt;SSH servers store authorized public keys inside:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Any public key listed there can authenticate as that user.&lt;/p&gt;




&lt;h3&gt;
  
  
  Method 1: Cloud Provider
&lt;/h3&gt;

&lt;p&gt;When launching an AWS EC2 instance, AWS can automatically place your public key on the server.&lt;/p&gt;

&lt;p&gt;This is the most common method when learning cloud infrastructure.&lt;/p&gt;




&lt;h3&gt;
  
  
  Method 2: ssh-copy-id
&lt;/h3&gt;

&lt;p&gt;If you already have password access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/id_ed25519.pub username@server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This automatically installs your public key.&lt;/p&gt;




&lt;h3&gt;
  
  
  Method 3: Manual Method
&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;cat&lt;/span&gt; ~/.ssh/id_ed25519.pub | ssh username@server_ip &lt;span class="s2"&gt;"mkdir -p ~/.ssh &amp;amp;&amp;amp; cat &amp;gt;&amp;gt; ~/.ssh/authorized_keys"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This manually appends your public key to the server's authorized keys file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Connecting to a Remote Server
&lt;/h2&gt;

&lt;p&gt;Basic SSH connection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh username@server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;ssh ubuntu@203.0.113.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once connected, you'll receive a remote terminal session.&lt;/p&gt;




&lt;h2&gt;
  
  
  Using a Specific Key
&lt;/h2&gt;

&lt;p&gt;If your key is stored in a different location:&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;-i&lt;/span&gt; ~/.ssh/my-aws-key.pem ubuntu@203.0.113.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells SSH exactly which key to use.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common SSH Permission Error
&lt;/h2&gt;

&lt;p&gt;You may encounter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Permissions 0644 for 'my-aws-key.pem' are too open.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SSH refuses to use keys that other users can read.&lt;/p&gt;

&lt;p&gt;Fix it:&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;chmod &lt;/span&gt;400 my-aws-key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the file readable only by you.&lt;/p&gt;




&lt;h2&gt;
  
  
  Simplifying Connections with SSH Config
&lt;/h2&gt;

&lt;p&gt;Instead of remembering long commands, create:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&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;Host my-ec2-server
    HostName 203.0.113.5
    User ubuntu
    IdentityFile ~/.ssh/my-aws-key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now connect using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh my-ec2-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This becomes incredibly useful when managing multiple servers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Transferring Files with SCP
&lt;/h2&gt;

&lt;p&gt;SCP (Secure Copy) uses SSH to transfer files securely.&lt;/p&gt;




&lt;h3&gt;
  
  
  Copy a Local File to a Server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/my-key.pem local-file.txt ubuntu@203.0.113.5:/home/ubuntu/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Copy a Remote File to Your Computer
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/my-key.pem ubuntu@203.0.113.5:/home/ubuntu/file.txt ./
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Copy an Entire Directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/my-key.pem ./project/ ubuntu@203.0.113.5:/home/ubuntu/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-r&lt;/code&gt; flag means recursive.&lt;/p&gt;




&lt;h2&gt;
  
  
  SCP Syntax Made Simple
&lt;/h2&gt;

&lt;p&gt;Think of SCP exactly like the Linux &lt;code&gt;cp&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nb"&gt;source &lt;/span&gt;destination
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only difference is that remote locations use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user@host:/path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of a normal local path.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Command Reference
&lt;/h2&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;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ssh-keygen&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Generate SSH keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ssh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Connect to a remote server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ssh-copy-id&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Install public key on a server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;chmod 400 key.pem&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Secure private key permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;scp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transfer files securely&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;scp -r&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transfer directories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cat ~/.ssh/known_hosts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View trusted hosts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cat ~/.ssh/authorized_keys&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View authorized keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ssh -i key.pem&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Connect using a specific key&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;SSH is one of the foundational skills every DevOps engineer must master.&lt;/p&gt;

&lt;p&gt;Whether you're managing cloud servers, deploying applications, configuring CI/CD pipelines, or troubleshooting production systems, SSH is the secure gateway that gives you access.&lt;/p&gt;

&lt;p&gt;Learning SSH early will make your journey into AWS, Docker, Kubernetes, Terraform, and automation much easier.&lt;/p&gt;

&lt;p&gt;I'm currently documenting my DevOps learning journey and sharing beginner-friendly notes as I learn.&lt;/p&gt;

&lt;p&gt;If you have any SSH tips or best practices, feel free to share them in the comments.&lt;/p&gt;

&lt;p&gt;Happy Learning! 🚀🐧&lt;/p&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>ssh</category>
      <category>beginers</category>
    </item>
    <item>
      <title>⚙️ Linux Process Management Every DevOps Engineer Should Know</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Wed, 29 Jul 2026 17:55:06 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/linux-process-management-every-devops-engineer-should-know-403k</link>
      <guid>https://dev.to/themdmohiuddin/linux-process-management-every-devops-engineer-should-know-403k</guid>
      <description>&lt;p&gt;When an application stops responding, a server becomes slow, or a deployment suddenly fails, one of the first places a DevOps engineer looks is the Linux process list.&lt;/p&gt;

&lt;p&gt;Every web server, database, monitoring agent, Docker container, and CI/CD tool ultimately runs as a process inside the operating system.&lt;/p&gt;

&lt;p&gt;Understanding how processes work is a fundamental Linux skill that will help you troubleshoot servers, monitor resource usage, and manage applications effectively.&lt;/p&gt;

&lt;p&gt;In this article, I'll cover:&lt;/p&gt;

&lt;p&gt;✅ What a process is&lt;br&gt;
✅ Viewing running processes&lt;br&gt;
✅ Monitoring CPU and memory usage&lt;br&gt;
✅ Running jobs in the background&lt;br&gt;
✅ Killing processes safely&lt;br&gt;
✅ Checking disk and memory usage&lt;br&gt;
✅ Managing services with systemctl&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Process Management Matters in DevOps
&lt;/h2&gt;

&lt;p&gt;Every application you deploy goes through a lifecycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start → Run → Stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or sometimes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start → Run → Crash 😅
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a DevOps engineer, you'll frequently need to answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is my application actually running?&lt;/li&gt;
&lt;li&gt;Why is the server slow?&lt;/li&gt;
&lt;li&gt;Which process is consuming all the memory?&lt;/li&gt;
&lt;li&gt;How can I stop a misbehaving process?&lt;/li&gt;
&lt;li&gt;How do I ensure my application restarts after a reboot?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Linux process management provides the answers.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Process?
&lt;/h2&gt;

&lt;p&gt;A process is simply a running instance of a program.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run this command, Linux creates a new process.&lt;/p&gt;

&lt;p&gt;Every process has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Process ID (PID)&lt;/li&gt;
&lt;li&gt;A Parent Process ID (PPID)&lt;/li&gt;
&lt;li&gt;CPU usage&lt;/li&gt;
&lt;li&gt;Memory allocation&lt;/li&gt;
&lt;li&gt;A current state&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each running application on your system is represented by one or more processes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Viewing Running Processes
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Using ps
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;ps&lt;/code&gt; command provides a snapshot of currently running processes.&lt;/p&gt;

&lt;p&gt;Show processes running in your current terminal:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Show all processes:&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternative format:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;






&lt;h3&gt;
  
  
  Understanding ps Output
&lt;/h3&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;USER   PID  %CPU %MEM COMMAND
ana   1234   0.5  1.2 python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;USER&lt;/td&gt;
&lt;td&gt;Process owner&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PID&lt;/td&gt;
&lt;td&gt;Process ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;%CPU&lt;/td&gt;
&lt;td&gt;CPU usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;%MEM&lt;/td&gt;
&lt;td&gt;Memory usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;COMMAND&lt;/td&gt;
&lt;td&gt;Executed command&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Finding a Specific Process
&lt;/h3&gt;

&lt;p&gt;One of the most common DevOps commands:&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;Example:&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;docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This searches for running Docker processes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Monitoring Processes in Real Time
&lt;/h2&gt;

&lt;h3&gt;
  
  
  top
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;top&lt;/code&gt; command provides a live view of running processes.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;P&lt;/td&gt;
&lt;td&gt;Sort by CPU usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M&lt;/td&gt;
&lt;td&gt;Sort by memory usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;k&lt;/td&gt;
&lt;td&gt;Kill a process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;q&lt;/td&gt;
&lt;td&gt;Quit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  htop
&lt;/h3&gt;

&lt;p&gt;A more user-friendly version of top.&lt;/p&gt;

&lt;p&gt;Install:&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;htop
&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;htop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;Color-coded interface&lt;/li&gt;
&lt;li&gt;Easier navigation&lt;/li&gt;
&lt;li&gt;Better process management&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many Linux administrators prefer htop for daily use.&lt;/p&gt;




&lt;h2&gt;
  
  
  Running Processes in the Background
&lt;/h2&gt;

&lt;p&gt;Normally, commands run in the foreground.&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;sleep &lt;/span&gt;500
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your terminal remains occupied until the command finishes.&lt;/p&gt;




&lt;h3&gt;
  
  
  Run a Process in the Background
&lt;/h3&gt;

&lt;p&gt;Add &lt;code&gt;&amp;amp;&lt;/code&gt; at the end:&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;sleep &lt;/span&gt;500 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&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="o"&gt;[&lt;/span&gt;1] 12345
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;[1]&lt;/code&gt; = Job number&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;12345&lt;/code&gt; = PID&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your terminal becomes available immediately.&lt;/p&gt;




&lt;h2&gt;
  
  
  Listing Background Jobs
&lt;/h2&gt;

&lt;p&gt;View jobs running in the current terminal:&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;jobs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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="o"&gt;[&lt;/span&gt;1]+ Running &lt;span class="nb"&gt;sleep &lt;/span&gt;500 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Moving Jobs Between Background and Foreground
&lt;/h2&gt;

&lt;p&gt;Bring a job back to the foreground:&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;fg&lt;/span&gt; %1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send a suspended job to the background:&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;bg&lt;/span&gt; %1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Pause a Running Process
&lt;/h2&gt;

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

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

&lt;/div&gt;



&lt;p&gt;This pauses the process without terminating it.&lt;/p&gt;

&lt;p&gt;Then resume it:&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;bg&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful for long-running commands.&lt;/p&gt;




&lt;h2&gt;
  
  
  Stopping Processes
&lt;/h2&gt;

&lt;p&gt;Linux uses signals to communicate with processes.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;kill&lt;/code&gt; command sends those signals.&lt;/p&gt;




&lt;h3&gt;
  
  
  Graceful Shutdown
&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;kill &lt;/span&gt;12345
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sends:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SIGTERM (15)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application gets a chance to clean up before stopping.&lt;/p&gt;




&lt;h3&gt;
  
  
  Force Kill
&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;kill&lt;/span&gt; &lt;span class="nt"&gt;-9&lt;/span&gt; 12345
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sends:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SIGKILL (9)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The process stops immediately.&lt;/p&gt;

&lt;p&gt;No cleanup occurs.&lt;/p&gt;




&lt;h3&gt;
  
  
  Best Practice
&lt;/h3&gt;

&lt;p&gt;Always try:&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;kill &lt;/span&gt;PID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;before:&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;kill&lt;/span&gt; &lt;span class="nt"&gt;-9&lt;/span&gt; PID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Force-killing applications can sometimes cause data corruption.&lt;/p&gt;




&lt;h2&gt;
  
  
  Killing Processes by Name
&lt;/h2&gt;

&lt;p&gt;Instead of finding the PID manually:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

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

&lt;/div&gt;



&lt;p&gt;Very useful during troubleshooting.&lt;/p&gt;




&lt;h2&gt;
  
  
  Checking Disk Space
&lt;/h2&gt;

&lt;p&gt;One of the most common production issues is a full disk.&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;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Filesystem Size Used Avail Use%
/dev/sda1 50G 32G 16G 67%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-h&lt;/code&gt; flag means:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Checking Memory Usage
&lt;/h2&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;free &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;Mem: 7.8G 2.1G 3.2G
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important columns:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Used&lt;/td&gt;
&lt;td&gt;Memory currently used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Completely unused memory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Available&lt;/td&gt;
&lt;td&gt;Memory available to applications&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;Many people panic when they see low "Free" memory.&lt;/p&gt;

&lt;p&gt;Linux intentionally uses unused RAM for caching.&lt;/p&gt;

&lt;p&gt;The important value is:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



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

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Managing Services with systemctl
&lt;/h2&gt;

&lt;p&gt;Running commands with &lt;code&gt;&amp;amp;&lt;/code&gt; works for temporary tasks.&lt;/p&gt;

&lt;p&gt;Production services require something more reliable.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Jenkins&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These services are managed using:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Starting a Service
&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;sudo &lt;/span&gt;systemctl start nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Stopping a Service
&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;sudo &lt;/span&gt;systemctl stop nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Restarting a Service
&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;sudo &lt;/span&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Checking Service Status
&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;sudo &lt;/span&gt;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One of the most frequently used commands in Linux administration.&lt;/p&gt;




&lt;h2&gt;
  
  
  Enable Service at Boot
&lt;/h2&gt;

&lt;p&gt;Automatically start after reboot:&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 &lt;span class="nb"&gt;enable &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Disable automatic startup:&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 disable nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Understanding a Service File
&lt;/h2&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Unit]&lt;/span&gt;
&lt;span class="py"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;My Application&lt;/span&gt;
&lt;span class="py"&gt;After&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network.target&lt;/span&gt;

&lt;span class="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;ExecStart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/usr/bin/python3 /home/user/app.py&lt;/span&gt;
&lt;span class="py"&gt;Restart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;always&lt;/span&gt;
&lt;span class="py"&gt;User&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;

&lt;span class="nn"&gt;[Install]&lt;/span&gt;
&lt;span class="py"&gt;WantedBy&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important fields:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ExecStart&lt;/td&gt;
&lt;td&gt;Command to run&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restart=always&lt;/td&gt;
&lt;td&gt;Restart automatically if it crashes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User&lt;/td&gt;
&lt;td&gt;Run as a specific user&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WantedBy&lt;/td&gt;
&lt;td&gt;Start during system boot&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Reload systemd After Changes
&lt;/h2&gt;

&lt;p&gt;After editing a service 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;sudo &lt;/span&gt;systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&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 myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Quick Command Reference
&lt;/h2&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;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ps&lt;/td&gt;
&lt;td&gt;View running processes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ps aux&lt;/td&gt;
&lt;td&gt;View all processes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;top&lt;/td&gt;
&lt;td&gt;Live process monitoring&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;htop&lt;/td&gt;
&lt;td&gt;Enhanced process monitoring&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;jobs&lt;/td&gt;
&lt;td&gt;List background jobs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fg&lt;/td&gt;
&lt;td&gt;Move job to foreground&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bg&lt;/td&gt;
&lt;td&gt;Move job to background&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kill&lt;/td&gt;
&lt;td&gt;Stop a process gracefully&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kill -9&lt;/td&gt;
&lt;td&gt;Force kill a process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pkill&lt;/td&gt;
&lt;td&gt;Kill process by name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;killall&lt;/td&gt;
&lt;td&gt;Kill all matching processes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;df -h&lt;/td&gt;
&lt;td&gt;Check disk usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;free -h&lt;/td&gt;
&lt;td&gt;Check memory usage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;systemctl start&lt;/td&gt;
&lt;td&gt;Start a service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;systemctl stop&lt;/td&gt;
&lt;td&gt;Stop a service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;systemctl restart&lt;/td&gt;
&lt;td&gt;Restart a service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;systemctl status&lt;/td&gt;
&lt;td&gt;View service status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;systemctl enable&lt;/td&gt;
&lt;td&gt;Auto-start service on boot&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;Process management is one of the most important Linux skills for DevOps engineers.&lt;/p&gt;

&lt;p&gt;Whether you're troubleshooting a slow server, debugging an application, monitoring resource usage, or managing production services, these commands become part of your daily toolkit.&lt;/p&gt;

&lt;p&gt;The more comfortable you become with processes and services, the easier it will be to work with Docker containers, Kubernetes workloads, CI/CD pipelines, and cloud infrastructure.&lt;/p&gt;

&lt;p&gt;I'm currently documenting my DevOps learning journey and sharing beginner-friendly notes as I learn.&lt;/p&gt;

&lt;p&gt;If you have favorite Linux troubleshooting commands, feel free to share them in the comments.&lt;/p&gt;

&lt;p&gt;Happy Learning! 🐧🚀&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>systemadmin</category>
      <category>cloud</category>
    </item>
    <item>
      <title>🔐 Linux Permissions Every DevOps Engineer Should Know</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Tue, 28 Jul 2026 14:35:56 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/linux-permissions-every-devops-engineer-should-know-4o1e</link>
      <guid>https://dev.to/themdmohiuddin/linux-permissions-every-devops-engineer-should-know-4o1e</guid>
      <description>&lt;p&gt;If you're learning Linux for DevOps, sooner or later you'll encounter errors like:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Could not &lt;span class="nb"&gt;read &lt;/span&gt;private key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Operation not permitted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first, these errors can feel confusing. But once you understand Linux permissions, ownership, file searching, and command chaining, troubleshooting becomes much easier.&lt;/p&gt;

&lt;p&gt;In this article, I'll cover some of the most practical Linux concepts that DevOps engineers use every day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Linux permissions&lt;/li&gt;
&lt;li&gt;✅ chmod&lt;/li&gt;
&lt;li&gt;✅ chown&lt;/li&gt;
&lt;li&gt;✅ sudo&lt;/li&gt;
&lt;li&gt;✅ cat, head, and tail&lt;/li&gt;
&lt;li&gt;✅ grep and find&lt;/li&gt;
&lt;li&gt;✅ Piping and redirection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Permissions Are a Big Deal in DevOps
&lt;/h2&gt;

&lt;p&gt;Linux was designed as a multi-user operating system. Multiple users and processes can run on the same machine at the same time.&lt;/p&gt;

&lt;p&gt;Permissions exist to answer one important question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is this user or process allowed to read, write, or execute this file?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a DevOps engineer, permissions appear everywhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH won't allow login if your private key permissions are too open.&lt;/li&gt;
&lt;li&gt;Nginx needs permission to read your application's files.&lt;/li&gt;
&lt;li&gt;Docker containers often run as specific users, causing permission mismatches.&lt;/li&gt;
&lt;li&gt;CI/CD pipelines frequently fail because of permission issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding permissions can save hours of debugging.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Linux Permissions
&lt;/h2&gt;

&lt;p&gt;Run the following 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="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&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="nt"&gt;-rwxr-xr--&lt;/span&gt; 1 ana developers 220 Jul 27 10:00 deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first section contains the permission information:&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="nt"&gt;-rwxr-xr--&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's break it down.&lt;/p&gt;




&lt;h3&gt;
  
  
  File Types
&lt;/h3&gt;

&lt;p&gt;The first character indicates the file type.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symbol&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Regular file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;d&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;l&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Symbolic link&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Permission Groups
&lt;/h3&gt;

&lt;p&gt;The next nine characters are divided into three groups.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rwx     r-x     r--
---     ---     ---
Owner   Group   Others
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each group represents permissions for a different category of users.&lt;/p&gt;




&lt;h3&gt;
  
  
  Permission Meanings
&lt;/h3&gt;

&lt;h4&gt;
  
  
  For Files
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Permission&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;r&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read the file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;w&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Modify the file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;x&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Execute the file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  For Directories
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Permission&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;r&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List directory contents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;w&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create or delete files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;x&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Enter the directory using &lt;code&gt;cd&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;Consider:&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="nt"&gt;-rwxr-xr--&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;Owner (&lt;code&gt;rwx&lt;/code&gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read&lt;/li&gt;
&lt;li&gt;Write&lt;/li&gt;
&lt;li&gt;Execute&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Group (&lt;code&gt;r-x&lt;/code&gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read&lt;/li&gt;
&lt;li&gt;Execute&lt;/li&gt;
&lt;li&gt;Cannot modify&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Others (&lt;code&gt;r--&lt;/code&gt;)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read only&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Understanding the Full Output
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;-rwxr-xr--&lt;/span&gt; 1 ana developers 220 Jul 27 10:00 deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Number of hard links&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ana&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Owner&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;developers&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Group&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;220&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;File size&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Jul 27 10:00&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Last modified&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;deploy.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;File name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  chmod — Changing Permissions
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;chmod&lt;/code&gt; command is used to modify permissions.&lt;/p&gt;

&lt;p&gt;There are two common approaches.&lt;/p&gt;




&lt;h3&gt;
  
  
  Method 1: Symbolic Notation
&lt;/h3&gt;

&lt;p&gt;Add execute permission for the owner:&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;chmod &lt;/span&gt;u+x deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove write permission from the group:&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;chmod &lt;/span&gt;g-w deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set others to read-only:&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;chmod &lt;/span&gt;&lt;span class="nv"&gt;o&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;r deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add read permission for everyone:&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;chmod &lt;/span&gt;a+r deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Symbol Meanings
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symbol&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;u&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;User (owner)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;g&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Group&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;o&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Others&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;a&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Method 2: Numeric (Octal) Notation
&lt;/h3&gt;

&lt;p&gt;This is the method you'll see most often in DevOps.&lt;/p&gt;

&lt;p&gt;Each permission has a value:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Permission&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Read&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execute&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Common Permission Values
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;th&gt;Permission&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;rwx&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;rw-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;r-x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;r--&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;---&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  Example
&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;chmod &lt;/span&gt;754 deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This translates to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Owner  = 7 = rwx
Group  = 5 = r-x
Others = 4 = r--
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Common chmod Values Used in DevOps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  SSH Private Keys
&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;chmod &lt;/span&gt;600 id_rsa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only the owner can read and write the file.&lt;/p&gt;

&lt;p&gt;SSH often refuses to use private keys with weaker permissions.&lt;/p&gt;




&lt;h3&gt;
  
  
  Configuration Files
&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;chmod &lt;/span&gt;644 config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Owner can modify the file.&lt;/p&gt;

&lt;p&gt;Everyone else can read it.&lt;/p&gt;




&lt;h3&gt;
  
  
  Scripts and Executables
&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;chmod &lt;/span&gt;755 deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everyone can run the script.&lt;/p&gt;

&lt;p&gt;Only the owner can modify it.&lt;/p&gt;




&lt;h3&gt;
  
  
  Sensitive Files
&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;chmod &lt;/span&gt;400 secrets.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Owner can read the file.&lt;/p&gt;

&lt;p&gt;Nobody else has access.&lt;/p&gt;




&lt;h2&gt;
  
  
  chown — Changing Ownership
&lt;/h2&gt;

&lt;p&gt;While &lt;code&gt;chmod&lt;/code&gt; controls permissions, &lt;code&gt;chown&lt;/code&gt; controls ownership.&lt;/p&gt;




&lt;h3&gt;
  
  
  Change Owner
&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;chown &lt;/span&gt;ana deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changes the file owner to &lt;code&gt;ana&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Change Owner and Group
&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;chown &lt;/span&gt;ana:developers deploy.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Changes both owner and group.&lt;/p&gt;




&lt;h3&gt;
  
  
  Recursive Ownership Change
&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;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; ana:developers app/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Applies ownership changes to all files and directories inside the folder.&lt;/p&gt;




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

&lt;p&gt;Suppose a web application runs under:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If the files are owned by another user, the application may fail with:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;A common fix 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;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; www-data:www-data /var/www/myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  sudo — Temporary Administrator Access
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; allows a user to run commands with administrator privileges.&lt;/p&gt;




&lt;h3&gt;
  
  
  Update Packages
&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 update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Open a Root Shell
&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; &lt;span class="nt"&gt;-i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use carefully.&lt;/p&gt;




&lt;h3&gt;
  
  
  Change Ownership
&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 chown &lt;/span&gt;root:root file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Why Use sudo?
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Accountability
&lt;/h4&gt;

&lt;p&gt;Every sudo command is logged.&lt;/p&gt;

&lt;h4&gt;
  
  
  Security
&lt;/h4&gt;

&lt;p&gt;You only elevate privileges when necessary.&lt;/p&gt;

&lt;h4&gt;
  
  
  Control
&lt;/h4&gt;

&lt;p&gt;Administrators can grant limited access without giving full root permissions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reading Files in Linux
&lt;/h2&gt;

&lt;p&gt;When troubleshooting systems, reading logs and configuration files is a daily task.&lt;/p&gt;




&lt;h3&gt;
  
  
  cat
&lt;/h3&gt;

&lt;p&gt;Display the entire 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;app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  head
&lt;/h3&gt;

&lt;p&gt;Display 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;app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display the first 20 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; &lt;span class="nt"&gt;-n&lt;/span&gt; 20 app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  tail
&lt;/h3&gt;

&lt;p&gt;Display the last 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;tail &lt;/span&gt;app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display the last 50 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;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 50 app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  tail -f
&lt;/h3&gt;

&lt;p&gt;Monitor a file in real time.&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/access.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is one of the most frequently used commands in DevOps.&lt;/p&gt;

&lt;p&gt;It's perfect for watching logs while debugging applications or deployments.&lt;/p&gt;




&lt;h2&gt;
  
  
  grep — Searching Inside Files
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;grep&lt;/code&gt; command searches file contents for a specific pattern.&lt;/p&gt;




&lt;h3&gt;
  
  
  Find Errors
&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;grep&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt; app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Case-Insensitive Search
&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;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"error"&lt;/span&gt; app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Search Recursively
&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;grep&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"TODO"&lt;/span&gt; ./src
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Count Matches
&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;grep&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt; app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Show Line Numbers
&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;grep&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt; app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Exclude Matches
&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;grep&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"DEBUG"&lt;/span&gt; app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  find — Searching for Files
&lt;/h2&gt;

&lt;p&gt;Unlike &lt;code&gt;grep&lt;/code&gt;, the &lt;code&gt;find&lt;/code&gt; command searches for files and directories.&lt;/p&gt;




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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.log"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Files Modified Within One Day
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find /var/log &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-mtime&lt;/span&gt; &lt;span class="nt"&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Find Specific Directories
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Find Large Files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-size&lt;/span&gt; +100M
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  grep vs find
&lt;/h2&gt;

&lt;p&gt;This is a common beginner confusion.&lt;/p&gt;

&lt;h3&gt;
  
  
  grep
&lt;/h3&gt;

&lt;p&gt;Searches inside file contents.&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="s2"&gt;"ERROR"&lt;/span&gt; app.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  find
&lt;/h3&gt;

&lt;p&gt;Searches for files and directories.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.log"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Piping Commands
&lt;/h2&gt;

&lt;p&gt;One of Linux's greatest strengths is combining commands together.&lt;/p&gt;

&lt;p&gt;The pipe operator (&lt;code&gt;|&lt;/code&gt;) sends the output of one command as the input to another.&lt;/p&gt;




&lt;h3&gt;
  
  
  Find Error Messages
&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;cat &lt;/span&gt;app.log | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Count Error Messages
&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;cat &lt;/span&gt;app.log | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"ERROR"&lt;/span&gt; | &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;h3&gt;
  
  
  Find Running Nginx Processes
&lt;/h3&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;h3&gt;
  
  
  Search Command History
&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;history&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Output Redirection
&lt;/h2&gt;

&lt;p&gt;Redirection allows you to save command output into files.&lt;/p&gt;




&lt;h3&gt;
  
  
  Overwrite Output
&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;echo&lt;/span&gt; &lt;span class="s2"&gt;"Deployment started"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; deploy.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates a new file or replaces existing content.&lt;/p&gt;




&lt;h3&gt;
  
  
  Append Output
&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;echo&lt;/span&gt; &lt;span class="s2"&gt;"Step completed"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; deploy.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adds content to the end of the file.&lt;/p&gt;




&lt;h3&gt;
  
  
  More Examples
&lt;/h3&gt;

&lt;p&gt;Save directory contents:&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;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; files.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save only error messages:&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="s2"&gt;"ERROR"&lt;/span&gt; app.log &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; errors.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Important Warning
&lt;/h3&gt;

&lt;p&gt;Be careful when using:&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="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It overwrites the file completely.&lt;/p&gt;

&lt;p&gt;If you want to preserve existing content, use:&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="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Many engineers have accidentally overwritten important files by using the wrong operator.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Command Reference
&lt;/h2&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;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;chmod&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;chown&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change ownership&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Run commands as administrator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Display file contents&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;View beginning of a file&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;View end of a file&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;Follow logs in real time&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 inside files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;find&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Search for files and directories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;`&lt;/td&gt;
&lt;td&gt;`&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Overwrite file output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Append file output&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




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

&lt;p&gt;Linux permissions, ownership, file searching, and command chaining are fundamental skills for every DevOps engineer.&lt;/p&gt;

&lt;p&gt;The better you understand these concepts, the easier it becomes to troubleshoot servers, debug deployments, manage containers, and automate infrastructure.&lt;/p&gt;

&lt;p&gt;I'm currently documenting my DevOps learning journey and will continue sharing beginner-friendly guides on Linux, Docker, Git, Kubernetes, Jenkins, Terraform, AWS, and more.&lt;/p&gt;

&lt;p&gt;If you have any tips or favorite Linux commands, feel free to share them in the comments.&lt;/p&gt;

&lt;p&gt;Happy Learning! 🐧🚀&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>tutorials</category>
    </item>
    <item>
      <title>🐧 Linux Basics Every Developer Should Know</title>
      <dc:creator>Md Mohiuddin</dc:creator>
      <pubDate>Sun, 26 Jul 2026 15:21:43 +0000</pubDate>
      <link>https://dev.to/themdmohiuddin/linux-basics-every-developer-should-know-4g08</link>
      <guid>https://dev.to/themdmohiuddin/linux-basics-every-developer-should-know-4g08</guid>
      <description>&lt;p&gt;If you're learning DevOps, Cloud, or Backend Development, Linux is a skill you simply can't avoid.&lt;/p&gt;

&lt;p&gt;Most production servers run Linux. Docker containers run on Linux. Kubernetes is built around Linux. Even many cloud services are powered by Linux.&lt;/p&gt;

&lt;p&gt;As part of my DevOps learning journey, I started with the Linux fundamentals. In this article, I'll share the concepts and commands every beginner should know.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Linux?
&lt;/h2&gt;

&lt;p&gt;Linux is an open-source operating system kernel that acts as the bridge between software and hardware.&lt;/p&gt;

&lt;p&gt;It manages resources like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;Storage&lt;/li&gt;
&lt;li&gt;Devices&lt;/li&gt;
&lt;li&gt;Running processes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whenever you execute a command, Linux communicates with the hardware on your behalf.&lt;/p&gt;

&lt;h2&gt;
  
  
  Popular Linux Distributions
&lt;/h2&gt;

&lt;p&gt;Linux comes in many distributions (often called &lt;strong&gt;distros&lt;/strong&gt;), each designed for different use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Debian-Based
&lt;/h3&gt;

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

&lt;ul&gt;
&lt;li&gt;Ubuntu&lt;/li&gt;
&lt;li&gt;Debian&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Package Manager:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;These distributions are popular among developers because they're easy to use and have excellent community support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Red Hat-Based
&lt;/h3&gt;

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

&lt;ul&gt;
&lt;li&gt;Red Hat Enterprise Linux (RHEL)&lt;/li&gt;
&lt;li&gt;CentOS&lt;/li&gt;
&lt;li&gt;Fedora&lt;/li&gt;
&lt;li&gt;Amazon Linux&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Package Managers:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;These are commonly used in enterprise environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alpine Linux
&lt;/h3&gt;

&lt;p&gt;Package Manager&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Alpine is extremely lightweight and is widely used for Docker containers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding the Linux File System
&lt;/h3&gt;

&lt;p&gt;Unlike Windows, Linux has a single directory tree that starts from the root directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
├── bin/
├── boot/
├── dev/
├── etc/
├── home/
├── lib/
├── media/
├── mnt/
├── opt/
├── proc/
├── root/
├── sbin/
├── tmp/
├── usr/
└── var/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what each directory is used for.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Directory&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/bin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Essential command binaries like &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cp&lt;/code&gt;, and &lt;code&gt;cat&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/boot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Bootloader and Linux kernel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/dev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Device files (USB, disks, terminals, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/etc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;System configuration files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/home&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Home directories for normal users&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/lib&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shared libraries used by applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/media&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Automatically mounted removable media&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/mnt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Temporary mount point&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/opt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Optional third-party software&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/proc&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Information about running processes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/root&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Home directory of the root user&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/sbin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;System administration commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/tmp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Temporary files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/usr&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;User applications and documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/var&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Logs, caches, databases, and changing data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Navigating the File System
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Show Current Directory
&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;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays your current working directory.&lt;/p&gt;




&lt;h3&gt;
  
  
  List Files
&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;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lists files and folders.&lt;/p&gt;

&lt;p&gt;Detailed 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;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Include hidden 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;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Change Directory
&lt;/h3&gt;

&lt;p&gt;Go to another 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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go back one level:&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; ..
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go to your home 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; ~
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Return to the previous 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; -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Understanding Paths
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Absolute Path
&lt;/h3&gt;

&lt;p&gt;Always starts from the root directory.&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;/home/mohiuddin/projects/app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No matter where you currently are, this path always points to the same file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Relative Path
&lt;/h3&gt;

&lt;p&gt;Relative paths depend on your current location.&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;projects/app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're already inside:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;then both paths point to the same file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Useful Shortcuts
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shortcut&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Current directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;..&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Parent directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Home directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd -&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Previous directory&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Basic File Operations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create a Directory
&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;mkdir &lt;/span&gt;project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create nested 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;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; project/src/components
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Copy Files
&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;cp &lt;/span&gt;file.txt backup.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy directories recursively:&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;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; folder1 folder2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Move or Rename Files
&lt;/h3&gt;

&lt;p&gt;Rename:&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;mv &lt;/span&gt;old.txt new.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Move:&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;mv &lt;/span&gt;notes.txt /tmp/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Remove Files
&lt;/h3&gt;

&lt;p&gt;Delete 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;rm &lt;/span&gt;file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete a 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;rm&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Force delete:&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;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; folder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Warning:&lt;/strong&gt; &lt;code&gt;rm -rf&lt;/code&gt; permanently deletes files without asking for confirmation. Always double-check the path before running it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Create an Empty File
&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;touch &lt;/span&gt;notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Display File Contents
&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;cat &lt;/span&gt;notes.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Today I learned Linux basics.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Quick Command Reference
&lt;/h2&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;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pwd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show current directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ls -la&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show all files including hidden&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mkdir&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Copy files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mv&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move or rename files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;touch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create empty file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cat&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Display file contents&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

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

&lt;p&gt;Linux is one of the most valuable skills for software developers, especially if you're interested in DevOps, Cloud Computing, Docker, Kubernetes, or Backend Development.&lt;/p&gt;

&lt;p&gt;These commands may seem simple, but you'll use them every day when working with servers and containers.&lt;/p&gt;

&lt;p&gt;I'm currently documenting my DevOps learning journey, and I'll continue sharing beginner-friendly guides on Git, Docker, Kubernetes, Jenkins, Terraform, AWS, and more.&lt;/p&gt;

&lt;p&gt;If you have any tips for Linux beginners, feel free to share them in the comments.&lt;/p&gt;

&lt;p&gt;Happy Learning! 🐧&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
