? Linux For DevOps - My Personal Learning Guide ??
? Linux For DevOps - My Personal Learning Guide ??
Fundamentals of Linux
Operating System (OS):
An Operating System (OS) is system software that acts as an intermediary between
computer hardware and the user. It manages hardware resources and provides a set of
services for application software.
1. Process Management
2. Memory Management
o Handles virtual memory, where programs can use more memory than
physically available.
o Organizes and manages data on storage devices like hard drives or SSDs.
4. Device Management
5. User Interface
• High Stability: Linux systems can run for years without crashes, ensuring
better uptime and reliability.
The physical components of the computer (CPU, RAM, disk, network interfaces, etc.).
The Linux Kernel is responsible for directly managing system resources, including:
Allow user programs to request services from the kernel (like reading a file or
starting a process).
End-user programs like web browsers, text editors, DevOps tools, etc.
Applications interact with the OS using system calls via the shell or GUI.
Fun Fact:
• System software
• Package Manager
Each distro is tailored for different users — beginners, developers, security experts,
or servers.
Ubuntu – One of the most beginner-friendly distros, widely used for personal and server
use. It has great community support.
Debian – A very stable and reliable distro, often used as a base for other distros like
Ubuntu.
Fedora – A cutting-edge distro that introduces new features before they reach RHEL.
Arch Linux – A lightweight, rolling-release distro for advanced users who like
customization.
Just install Docker desktop, run the below command and create Linux
container of any distribution without worrying about the cost and connectivity
issues.
1. Repositories (Repos):
2. Installing Software:
3. Updating Software:
4. Removing Software:
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
When you install Ubuntu, the packages included in the ISO image might be
outdated. Running:
Zypper (OpenSUSE)
Each folder has a specific purpose, and understanding this structure helps you navigate,
troubleshoot, and manage the system effectively.
/bin /usr/bin Essential user binaries (e.g., ls, cp, mv, bash)
Directory Description
/boot Stores files needed to boot the system (e.g., kernel, GRUB configs)
Directory Description
Holds data for system services like web servers (rarely used in
/srv
containers)
Directory Description
Mount Points:
Directory Description
/media Mount point for removable devices like USBs and CDs
/data Custom mount point (commonly used in WSL for Windows volumes like C:)
The superuser with full system access. Username: root. Can execute all
Root User
commands.
Normal
Created by the administrator or during OS installation. Limited permissions.
Users
System Created by the system for services (e.g., www-data, mysql). Typically, don’t
Users log in.
/etc/passwd Stores user account info (username, UID, home directory, shell)
• To specify a shell:
Modify a User:
Group Management:
• Create a Group:
• On Debian-based systems:
• On RHEL-based systems:
Then add:
cd Change directory
cd .. Go one level up
cd ~ Go to home directory
Create:
Rename / Move:
Delete:
Copy:
Command Description
echo 'Hello' > file.txt Writes text to a file, overwriting existing content.
Mode Description
Normal mode Default mode when vi starts — used for navigation and commands
Mode Switching:
Key Action
:q Quit
Command Action
Ctrl + r Redo
h Move left
l Move right
j Move down
k Move up
$ End of line
: n Go to line number n
SSH stands for Secure Shell. It's a protocol used to securely connect to a
remote computer over a network — typically used to access servers, Linux systems,
and cloud instances.
Think of SSH as a secure way to control another computer using the terminal
just like you're sitting in front of it!
• Encrypted Communication – All data sent between you and the server is
encrypted (safe from eavesdropping).
• Remote Access – Control remote systems from anywhere.
• File Transfer – Send and receive files securely via SCP/SFTP.
• Automation – Useful for running scripts, updates, and deployment tasks on
servers.
Example:
Basic Syntax:
Option Description
Linux file permissions determine who can read, write, or execute files and
directories. Each file and directory have three levels of permission:
👥 Types of Users:
Example Output:
Breakdown:
Examples:
Examples:
Sticky Bit (t on others execute bit): Used directories to allow only the owner
to delete their files.
Viewing Processes:
0 Default priority
Note: Only the root user can set negative nice values.
• Shows total, used, and free memory (RAM and swap) in megabytes.
💾 Disk Monitoring:
• Displays total and available disk space for mounted file systems.
• -h = human-readable sizes (e.g., GB/MB).
Network Monitoring:
• Performs the same job as Netstat but faster and with more
options.
• Pre-installed on most modern distros.
• Shows each hop between your system and the target server.
• It is useful to diagnose where network delays occur.
If not installed:
Log Monitoring:
Key Concepts:
Concept Description
Networking Commands:
View disk usage Check how much space is used and available
• Formats a partition with the ext4 file system (or other: xfs, ntfs, etc.)
• Shows the type of file system used on mounted partitions (e.g., ext4,
xfs, etc.)
Swap Management