Day 6: Linux & Shell Scripting Basics


When I first logged into a Linux server, I felt like I’d entered a different world.
No icons, no mouse clicks, no fancy windows. Just a blinking cursor.
And yet — this is the world where 90% of production systems live.
Amazon, Netflix, banking apps, SaaS platforms… all powered by Linux.
If you’re starting your DevOps journey, Linux and shell scripting aren’t just skills — they’re your bread and butter. Today, I’ll share the fundamentals I learned on Day 6 of my DevOps journey, with real examples you can try right now.
1. What Exactly is an Operating System?
Think of an OS as the bridge between your apps and your hardware.
Flow looks like this:
👉 User → Application → Operating System → Hardware
👉 Hardware → Operating System → Application → User
When you open Chrome, it isn’t “talking” directly to your CPU. It’s asking the OS to handle that job.
Key takeaway: Without the OS, software and hardware wouldn’t understand each other.
2. Why Linux Rules the DevOps World
While Windows dominates our laptops, Linux is king in servers and DevOps environments. Here’s why:
Free & Open Source → No licenses needed. Anyone can build a Linux flavor.
Secure by default → No constant antivirus alerts.
Fast & Stable → Handles millions of requests without crashing.
Flexible → Distributions like Ubuntu, CentOS, Red Hat, Alpine, Debian fit different needs.
💡 Fun fact: ~90% of servers you test & deploy apps on will run Linux.
3. Linux OS Architecture (Simplified)
At its core:
Kernel → The “heart” of Linux, managing memory, processes, devices.
System Libraries → Tools apps use to request services from the kernel (e.g., libc).
User Processes & Compilers → Your applications, code, system software.
Think of the kernel as the traffic controller, ensuring cars (apps) and roads (hardware) move smoothly without chaos.
4. Shell Scripting: Talking to Linux
Servers rarely have a Graphical User Interface (GUI) — because it’s heavy and slows things down. Instead, we talk to Linux using the shell (command-line).
The most popular shell is Bash. Let’s explore some must-know commands, with real examples.
4.1 Navigating the File System
1. PWD – Present Working Directory
pwd
Output:
/home/ubuntu
👉 Shows where you are in the server. Always run this right after logging in.
2. LS – List Files
ls
Output:
file1.txt scripts logs
👉 Lists files & folders.
3. CD – Change Directory
cd scripts
pwd
Output:
/home/ubuntu/scripts
👉 Moves into the scripts
folder.
4.2 Creating & Editing Files
4. TOUCH – Create File
touch hello.txt
ls
Output:
hello.txt
👉 Creates an empty file.
5. VI – Edit File
vi hello.txt
Inside vi
:
Press
i
→ type:Welcome to DevOps!
Press
Esc :wq
→ save & quit
6. CAT – View File Content
cat hello.txt
Output:
Welcome to DevOps!
👉 Displays file contents.
4.3 Organizing Files
7. MKDIR – Create Directory
mkdir projects
ls
Output:
projects/
8. RM – Remove File
rm hello.txt
9. RM -R – Remove Directory
rm -r projects
👉 Powerful but dangerous — it will delete everything inside!
4.4 Monitoring the System
As a DevOps engineer, you need to constantly check server health.
10. FREE – Check Memory
free -mh
Output:
total used free
Mem: 1.9G 512M 1.4G
11. NPROC – CPU Cores
nproc
Output:
2
12. DF – Disk Usage
df -h
Output:
Filesystem Size Used Avail
/dev/xvda1 30G 10G 20G
13. TOP – Running Processes
top
Live output: CPU %, memory %, running processes.
👉 Interview favorite: “How do you check server load in Linux?” → Answer: top
.
5. Why Shell Scripting Matters
Every click in a GUI = a command behind the scenes.
With shell scripting, you can:
Automate repetitive tasks
Run batch jobs
Manage deployments
Monitor systems
This is why Linux + Bash is a must for every DevOps engineer.
✅ My Key Takeaways from Day 6
Linux isn’t just another OS — it’s the foundation of modern DevOps.
The shell is how you “talk” to Linux.
Mastering even 10–15 commands can make you 10x faster.
Every command you learn is a building block toward automation.
💬 Question for you:
👉 What was the first Linux command you ever learned? (Mine was ls
🙈)
Drop yours in comments below 👇
Subscribe to my newsletter
Read articles from Abhishek Jha directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Abhishek Jha
Abhishek Jha
I have experience in working with Arduino, Nodemcu projects, Artificial intelligence, python, IoT based projects, Mini humanoid and many project based on these categories. Programming knowledge related to python, C , C++, Embedded C, Social media management etc. I have visited multiple international and Cambridge schools and junior colleges across India For Workshops Related to the above-mentioned field of studies. Currently i am working with JBCN Oshiwara.. I have started Learning DevOps & Artificial Intelligence..