π§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 |
β Purpose | For personal use | For managing network or multiple users |
π§βπ« Examples | Windows 10, macOS, Ubuntu | Windows Server, Red Hat Enterprise Linux |
π§© Apps | Browsers, media players | Web server, database |
π₯ Users | One user at a time | Many users at once |
π‘οΈ Security | Basic | Advanced 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 π:
Hardware (CPU, RAM, etc.)
Kernel (heart of the OS) β talks to hardware π¬
Shell (command-line interface) β takes user input π¨βπ»
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 file | vim filename.txt |
Enter Insert mode | Press i |
Exit Insert mode | Press 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 / Debian | apt | sudo apt install app-name |
β General Steps to Install an App:
π Update package list
sudo apt update
π₯ Install the app
sudo apt install app-name
π 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:
Or check with:
curl http://localhost
You should see:
βWelcome to nginx!β π
π₯ Bonus Commands:
π οΈ Task | π€ Command |
Restart nginx | sudo systemctl restart nginx |
Stop nginx | sudo systemctl stop nginx |
Status of nginx | sudo 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 user | sudo adduser username |
Switch user | su - username |
Exit user | exit or Ctrl + D |
Subscribe to my newsletter
Read articles from sarvesh chaudhari directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
