🐧Linux For DevOps

🌐 1) What is an Operating System (OS)?

An Operating System (OS) is like the manager of your computer or mobile phone.

🧠 It controls everything β€” from running apps to managing hardware.

πŸ“± Think of it like:

A smartphone has apps (games, camera, browser), but behind the scenes, Android or iOS helps them run.

πŸ”§ Functions:

  • πŸ§‘β€πŸ’Ό Manages hardware (CPU, memory, storage)

  • πŸ“‚ Controls files and folders

  • 🧩 Runs and manages apps

  • πŸ‘₯ Handles users and permissions


πŸ’» 2) Client OS vs Server OS

  • Client OS = Personal Use (like your laptop/phone)

  • Server OS = Business Use (like running websites or apps for many people)

πŸ” FeatureπŸ‘¨β€πŸ’» Client OSπŸ–₯️ Server OS
βœ… PurposeFor personal useFor managing network or multiple users
πŸ§‘β€πŸ« ExamplesWindows 10, macOS, UbuntuWindows Server, Red Hat Enterprise Linux
🧩 AppsBrowsers, media playersWeb server, database
πŸ‘₯ UsersOne user at a timeMany users at once
πŸ›‘οΈ SecurityBasicAdvanced and customizable

🐧 3) What is Linux OS?

Linux is a free, open-source operating system πŸ†“πŸ‘¨β€πŸ’»
It powers servers, desktops, Android phones, supercomputers, and more!

πŸ”₯ Why Linux is cool:

  • πŸ’Έ Free to use

  • πŸ” Secure and stable

  • πŸ› οΈ Used by developers, IT pros, and hackers!

  • 🌍 Powers most of the Internet servers

πŸ§‘β€πŸ’» Common Linux OS versions (called "distributions"):

  • Ubuntu

  • Fedora

  • Debian

βš™οΈ 4) How Linux Works

Imagine Linux as a layered cake πŸŽ‚:

  1. Hardware (CPU, RAM, etc.)

  2. Kernel (heart of the OS) – talks to hardware πŸ’¬

  3. Shell (command-line interface) – takes user input πŸ‘¨β€πŸ’»

  4. Applications – browsers, editors, etc. πŸ“±

When you give a command ➑️ Linux passes it through the shell, and the kernel performs the task.

πŸ”Ή 1) Application πŸ“±

These are programs you run (like browsers, editors, terminal).

πŸ‘‰ They send tasks to the system (e.g., create a file, show files).


πŸ”Ή 2) Shell πŸ’»

This is the middle layer (like a translator).

πŸ‘‰ It takes your commands (like ls, mkdir) and passes them to the kernel.


πŸ”Ή 3) Kernel 🧠

The core of Linux that talks to the hardware.

πŸ‘‰ It performs tasks like creating folders, reading files, using memory, etc.

πŸ” Example Flow:

$mkdir myfolder

  • βœ… App (terminal) β†’ Shell understands it β†’ Kernel creates the folder.

    App asks β†’ Shell translates β†’ Kernel executes βœ…

5) Basic Linux Commands & Their Use

πŸ”€ Command⚑ Use
pwdπŸ“ Show current folder you're in
lsπŸ“‚ List files in the folder
cd foldernameπŸšͺ Go inside a folder
cd ..πŸ”™ Move one step back in folders
mkdir foldernameπŸ†• Create a new folder
touch filename.txtπŸ“„ Create a new file
rm filenameπŸ—‘οΈ Delete a file
rmdir foldernameπŸ—‘οΈ Delete an empty folder
rm -r foldername🧹 Delete folder with contents
mv old newβœ‚οΈ Rename or move a file/folder
chmod 755 fileπŸ” Change file permissions
clear🧽 Clear the terminal screen
man commandπŸ“˜ Help for any command (manual)

πŸ“ What is Vim Editor?

Vim is a powerful text editor in Linux, used mostly from the terminal.
It helps you create and edit files β€” especially useful for coding, scripting, and config files.

✨ Think of it like Notepad, but for the terminal β€” and with superpowers!

πŸš€ Common Vim Commands

πŸ–±οΈ ActionπŸ’» Vim Command
Open filevim filename.txt
Enter Insert modePress i
Exit Insert modePress Esc
Save and quit:wq then Enter
Quit without saving:q! then Enter

πŸ’‘ How to Install Applications in Linux?

In Linux, we install apps using package managers (no .exe files like Windows).

πŸ”§ Common Package Managers:

🐧 Linux OSπŸ“¦ Package ManagerπŸ§‘ Command
Ubuntu / Debianaptsudo apt install app-name

βœ… General Steps to Install an App:

  1. πŸ”„ Update package list

    sudo apt update

  2. πŸ“₯ Install the app

    sudo apt install app-name

  3. 🏁 Done! Run it by typing the app’s name.

🌐 How to Install Nginx Web Server

Let’s install Nginx on Ubuntu/Debian-based Linux.

πŸ’» Commands:

sudo apt update # Step 1: Update package info

sudo apt install nginx # Step 2: Install nginx

▢️ Start and Enable Nginx:

sudo systemctl start nginx # Start the server now

sudo systemctl enable nginx # Start nginx on every boot

βœ… Check if it’s working:

Open your browser and go to:

http://localhost

Or check with:

curl http://localhost

You should see:
β€œWelcome to nginx!” πŸŽ‰

πŸ”₯ Bonus Commands:

πŸ› οΈ TaskπŸ”€ Command
Restart nginxsudo systemctl restart nginx
Stop nginxsudo systemctl stop nginx
Status of nginxsudo systemctl status nginx

🧠 How Multiple Users Work at the Same Time in linux:

πŸ‘₯ Linux = Multi-User System

βœ… How it works:

  • Each user has a separate account πŸ§‘β€πŸ’»

  • Users can log in at the same time (locally or via SSH 🌐)

  • Linux runs multiple tasks separately for each user βš™οΈ

  • Permissions keep files private πŸ”

  • The kernel manages users and processes smoothly 🧠


πŸ§ͺ Example:

  • User A works on terminal 1

  • User B logs in remotely via SSH

  • Both run different programs at the same time βœ…

πŸ‘€ 1) How to Create a New User,Switch Users and Exit or Go Back

πŸ› οΈ TaskπŸ’» Command
Create usersudo adduser username
Switch usersu - username
Exit userexit or Ctrl + D
0
Subscribe to my newsletter

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

Written by

sarvesh chaudhari
sarvesh chaudhari