Day 4 - Linux & Shell Scripting basics
Hi there! I'm Dinesh, a passionate Cloud and DevOps enthusiast. I love to dive into the latest new technologies and sharing my journey through blog.
Search for a command to run...
Hi there! I'm Dinesh, a passionate Cloud and DevOps enthusiast. I love to dive into the latest new technologies and sharing my journey through blog.
No comments yet. Be the first to comment.
1. Difference between Docker and Kubernetes Docker β Builds and runs containers.Kubernetes β Orchestrates containers across multiple nodes. Key points: Docker = container runtime. Kubernetes = container orchestration tool. Kubernetes provides auto...
In this session, we learn how to monitor a Kubernetes cluster using Prometheus and Grafana.This is not just theory β there is a GitHub repository containing all installation commands and demo steps.The repo will also be enhanced later with advanced K...
1. What is a ConfigMap in Kubernetes? A ConfigMap is used to store non-sensitive configuration data that your application needs β such as: Database port Connection type Any general configuration values In normal applications (non-Kubernetes), de...
Kubernetes normally supports built-in resources like: Deployment Service Pod ConfigMap Secret Ingress These are called native resources. Sometimes companies (Istio, ArgoCD, Prometheus Operator, Kyverno, etc.) want to add new features that Kub...
1. Why Kubernetes Services Are Needed When a Pod is created in Kubernetes, it receives a dynamic IP address.If the Pod dies and restarts, its IP changes.So other Pods (like checkout β payments) cannot rely on Pod IP because it changes, creating issue...
An Operating System is a software layer that acts as a bridge between hardware and software.
User runs an application (software)
Software sends request β Operating System
OS interacts with Hardware (CPU, RAM, Storage, IO)
Response travels back the same way
OS = Medium that enables communication between Hardware and Software
Without an OS, applications cannot use CPU/RAM or perform any tasks.
Linux is the most used OS in servers & DevOps.
Free / Open-source
Secure
Fast & Lightweight
Stable
Flexible (Many Distributions)
Ubuntu, CentOS, RedHat, Debian, Alpine, Fedoraβ¦
Servers
Cloud VMs
Containers
Kubernetes
DevOps Tools (Jenkins, Docker, Ansible, GitLab CIβ¦)
+-------------------------+
| Applications / Softwares|
+-------------------------+
| Compilers | User Process|
| System Softwares |
+-------------------------+
| System Libraries (glibc) |
+-------------------------+
| Kernel (Heart of OS) |
+-------------------------+
| Hardware (CPU | RAM | IO)|
+-------------------------+
Device Management
Memory Management
Process Management
System Calls Handling
Shell = Interface to talk to the Linux OS using commands.
Windows β GUI
Linux Servers β CLI (Command Line Interface)
Popular shell β Bash
Shell allows:
Creating files
Navigating directories
Managing processes
Checking CPU/RAM
Writing scripts (.sh)
| Command | Meaning |
pwd | Show current directory |
ls | List files/folders |
ls -ltr | List with details |
cd foldername | Enter folder |
cd .. | Go back |
cd ../.. | Go two levels back |
touch file.txt # create file
mkdir folder # create directory
vi file.txt
Inside VI:
Press i β insert mode
Type content
Press Esc
Type :wq β save & exit
cat file.txt
rm file.txt # delete file
rm -r folder # delete folder
free -m
nproc
df -h
top
Shows:
CPU usage
Memory usage
Running processes
| Purpose | Command |
| Show path | pwd |
| List files | ls |
| Detailed list | ls -ltr |
| Change directory | cd |
| Create file | touch |
| Create folder | mkdir |
| Remove file | rm |
| Remove folder | rm -r |
| Open file | vi |
| Print file | cat |
| CPU count | nproc |
| Memory | free -m |
| Disk | df -h |
| Process monitoring | top |
Shell scripts are used for:
Automating deployments
Creating scheduled jobs (cron)
Server maintenance
Log monitoring
Starting/stopping services
CI/CD pipelines