My Linux Discoveries

Vidhi ChadhaVidhi Chadha
6 min read

Hey there, fellow tech enthusiasts! 👋

If you’re like me, a newcomer in the DevOps world, you might have heard the buzz about Linux and wondered, "Where do I even start?" Well, you’re in the right place! This blog is all about sharing my journey of learning Linux from scratch, while also helping you understand the basics and essentials. So, grab your favourite beverage ☕, and let’s dive into the wonderful world of Linux!

Why Linux? 🤔

Before we jump into commands and architecture, let’s answer the question: Why should you care about Linux?

Here are a few reasons that convinced me (and probably will convince you too!):

  • Open Source: Linux is free, and it has a massive community that keeps improving it.

  • Customization: It’s incredibly flexible and can be customized to suit your needs.

  • Dominates Servers: Most servers around the world run on Linux.

  • DevOps Favorite: Most DevOps tools are built with Linux in mind, making it essential for automation.

  • Security: It’s more secure and less vulnerable to malware compared to other operating systems.

Linux is everywhere! So, if you want to excel in DevOps, getting a good grip on Linux is non-negotiable.

Understanding Linux Architecture 🏛️

Before we get into the fun stuff, let’s take a look at the architecture of Linux. Linux is based on a multi-layered structure, making it both powerful and reliable. It consists of:

  1. Kernel: The core of the operating system that handles interactions between software and hardware.

  2. Shell: The interface that lets you communicate with the kernel via commands.

  3. File System: Organizes files and data storage.

Think of the kernel as the brain 🧠, the shell as the mouth 🗣️, and the file system as the organized drawers where all your files live.

There are tons of Linux distributions (distros), and each has its own flavor. Here are some popular ones to consider:

For Desktop Use:

  • Ubuntu: User-friendly and perfect for beginners.

  • Linux Mint: Sleek design and easy to use.

  • Fedora: Great for developers.

For Servers:

  • Red Hat Enterprise Linux (RHEL): Widely used in enterprise environments.

  • CentOS: A free version of RHEL, great for server setups.

  • Ubuntu Server: Powerful and popular in cloud environments.

RPM vs. Debian-based Distros

  • RPM-based: Uses the .rpm package format (e.g., RHEL, CentOS).

  • Debian-based: Uses the .deb package format (e.g., Ubuntu).

If you’re just starting out, I’d recommend going with Ubuntu—it’s beginner-friendly and has great community support.

Linux Basics: Commands That Will Make You Feel Like a Pro 💻

Linux commands might seem intimidating at first, but once you get the hang of them, they become your best friend. Let’s go through some basic commands that you’ll use all the time.

  1. Opening the Terminal: Your terminal is where the magic happens! Open it by pressing Ctrl + Alt + T on most Linux systems.

  2. Know Where You Are:

     pwd
    

    This command tells you your present working directory.

  3. Creating a Directory:

     mkdir my-folder
    

    Boom! You just created your first folder in Linux.

  4. Navigating Directories:

     cd my-folder
    

    Use the cd command to move into your newly created folder.

  5. Listing Files:

     ls
    

    This will list all files in your current directory.

These are just a few basics to get you comfortable, but trust me, there’s so much more you can do!

Absolute vs. Relative Paths 📂

Understanding file paths is crucial in Linux. Here’s a quick breakdown:

  • Absolute Path: The complete path from the root directory, e.g., /home/user/my-folder.

  • Relative Path: A path relative to your current directory, e.g., if you’re already in /home/user, simply typing my-folder will take you to /home/user/my-folder.

Fun with VIM Editor: Become a Text Wizard 🧙‍♂️

Ah, the VIM editor! It’s like stepping into a magical land where the keyboard is your wand, and commands are your spells. Let’s walk through some of the essential VIM commands that will make you feel like a true wizard of text editing.

Navigation Commands: Move Like a Ninja! 🥷

VIM can be a bit intimidating at first, but once you get the hang of it, you’ll be zipping through files like a pro. Here are some commands to help you navigate quickly:

  • gg - Go to the top of the file: Need to get to the beginning of the document in a flash? Just type gg and you’ll teleport to the top!

  • G - Go to the bottom of the file: Want to zoom straight to the end? Just type G (capital G) and you’ll be at the bottom in no time.

Imagine yourself as a text-editing ninja, jumping to the top and bottom of the file in a heartbeat. ⚡

Searching in VIM: Finding Stuff is a Breeze 🔍

Lost in a sea of text? Don't worry, VIM's search commands are like a map that guides you to the treasure!

  • /pattern - Search forward for 'pattern': Type / followed by your search term (like /error) to quickly find the next occurrence of that word. It’s like casting a spell to find hidden clues!

  • ?pattern - Search backward for 'pattern': This one works just like / but searches in the opposite direction.

  • n - Repeat the last search in the same direction: Keep hitting n to jump to the next match.

  • N - Repeat the last search in the opposite direction: If you missed something while searching, N will take you back to the previous match.

It's almost like you're using a magnifying glass 🔎 to scan through your text!

File Operations: Save Like a Boss 🗂️

When it comes to saving and managing files in VIM, these commands will make sure you never lose your work:

  • :w - Save the file: Whenever you make changes, type :w to save your progress like a true professional.

  • :q - Quit Vim: Ready to leave VIM? Type :q to exit.

  • :wq - Save and quit: Type this command to save all your work and gracefully exit VIM.

  • :q! - Quit without saving: Changed your mind? :q! lets you leave without saving your changes—like hitting the "undo" button on life.

  • :e filename - Open a file: Want to open another file without leaving VIM? Just type :e followed by the filename.

Think of these commands as your save points in a game—keeping your progress safe at all times! 🎮

Showing and Hiding Line Numbers: Because Details Matter 📋

Sometimes, it’s helpful to see line numbers in your file, especially when you’re debugging code. Here’s how you can toggle them on and off in VIM:

  • :set number - Show line numbers: This command makes line numbers magically appear, making it easier to find your place.

  • :set nonumber - Hide line numbers: Poof! Type this to make those numbers disappear when you no longer need them.

Now you’re in control of your VIM universe—showing or hiding details with just a flick of your wand! 🪄.

Why Linux is Your DevOps Best Friend 🤝

Linux isn’t just another operating system; it’s the heart of DevOps. Most DevOps tools (like Docker, Jenkins, and Kubernetes) were built with Linux in mind. As you start your journey into DevOps, mastering Linux will open doors to automate, secure, and deploy your applications like never before.

Final Thoughts 🏁

I’m still on my journey to mastering Linux, but I wanted to share what I’ve learned so far. If you’re also new to DevOps, let’s learn together! Comment below if you have questions or tips of your own. Let’s make this a community where we all grow together!

2
Subscribe to my newsletter

Read articles from Vidhi Chadha directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vidhi Chadha
Vidhi Chadha