If you're learning DevOps, Cloud, or Backend Development, Linux is a skill you simply can't avoid.
Most production servers run Linux. Docker containers run on Linux. Kubernetes is built around Linux. Even many cloud services are powered by Linux.
As part of my DevOps learning journey, I started with the Linux fundamentals. In this article, I'll share the concepts and commands every beginner should know.
What is Linux?
Linux is an open-source operating system kernel that acts as the bridge between software and hardware.
It manages resources like:
- CPU
- Memory
- Storage
- Devices
- Running processes
Whenever you execute a command, Linux communicates with the hardware on your behalf.
Popular Linux Distributions
Linux comes in many distributions (often called distros), each designed for different use cases.
Debian-Based
Examples:
- Ubuntu
- Debian
Package Manager:
apt
These distributions are popular among developers because they're easy to use and have excellent community support.
Red Hat-Based
Examples:
- Red Hat Enterprise Linux (RHEL)
- CentOS
- Fedora
- Amazon Linux
Package Managers:
yum
or
dnf
These are commonly used in enterprise environments.
Alpine Linux
Package Manager
apk
Alpine is extremely lightweight and is widely used for Docker containers.
Understanding the Linux File System
Unlike Windows, Linux has a single directory tree that starts from the root directory.
/
├── bin/
├── boot/
├── dev/
├── etc/
├── home/
├── lib/
├── media/
├── mnt/
├── opt/
├── proc/
├── root/
├── sbin/
├── tmp/
├── usr/
└── var/
Here's what each directory is used for.
| Directory | Purpose |
|---|---|
/bin |
Essential command binaries like ls, cp, and cat
|
/boot |
Bootloader and Linux kernel |
/dev |
Device files (USB, disks, terminals, etc.) |
/etc |
System configuration files |
/home |
Home directories for normal users |
/lib |
Shared libraries used by applications |
/media |
Automatically mounted removable media |
/mnt |
Temporary mount point |
/opt |
Optional third-party software |
/proc |
Information about running processes |
/root |
Home directory of the root user |
/sbin |
System administration commands |
/tmp |
Temporary files |
/usr |
User applications and documentation |
/var |
Logs, caches, databases, and changing data |
Navigating the File System
Show Current Directory
pwd
Displays your current working directory.
List Files
ls
Lists files and folders.
Detailed list:
ls -l
Include hidden files:
ls -la
Change Directory
Go to another directory:
cd /var/log
Go back one level:
cd ..
Go to your home directory:
cd ~
Return to the previous directory:
cd -
Understanding Paths
Absolute Path
Always starts from the root directory.
Example:
/home/mohiuddin/projects/app.py
No matter where you currently are, this path always points to the same file.
Relative Path
Relative paths depend on your current location.
Example:
projects/app.py
If you're already inside:
/home/mohiuddin
then both paths point to the same file.
Useful Shortcuts
| Shortcut | Meaning |
|---|---|
. |
Current directory |
.. |
Parent directory |
~ |
Home directory |
cd - |
Previous directory |
Basic File Operations
Create a Directory
mkdir project
Create nested directories:
mkdir -p project/src/components
Copy Files
cp file.txt backup.txt
Copy directories recursively:
cp -r folder1 folder2
Move or Rename Files
Rename:
mv old.txt new.txt
Move:
mv notes.txt /tmp/
Remove Files
Delete a file:
rm file.txt
Delete a directory:
rm -r folder
Force delete:
rm -rf folder
⚠️ Warning:
rm -rfpermanently deletes files without asking for confirmation. Always double-check the path before running it.
Create an Empty File
touch notes.txt
Display File Contents
cat notes.txt
Example output:
Today I learned Linux basics.
Quick Command Reference
| Command | Description |
|---|---|
pwd |
Show current directory |
ls |
List files |
ls -la |
Show all files including hidden |
cd |
Change directory |
mkdir |
Create directory |
cp |
Copy files |
mv |
Move or rename files |
rm |
Remove files |
touch |
Create empty file |
cat |
Display file contents |
Final Thoughts
Linux is one of the most valuable skills for software developers, especially if you're interested in DevOps, Cloud Computing, Docker, Kubernetes, or Backend Development.
These commands may seem simple, but you'll use them every day when working with servers and containers.
I'm currently documenting my DevOps learning journey, and I'll continue sharing beginner-friendly guides on Git, Docker, Kubernetes, Jenkins, Terraform, AWS, and more.
If you have any tips for Linux beginners, feel free to share them in the comments.
Happy Learning! 🐧
Top comments (0)