Linux Basics
Learn the essential terminal commands you'll use every single day as a DevOps engineer.
Welcome to your first real Linux lesson. From here on you’ll work inside the terminal — just like professional DevOps, Cloud, and Site Reliability Engineers. Don’t worry if it feels new; every expert once typed their very first command.
🎯 Learning Objectives
By the end of this lesson you will be able to:
- Understand what the Linux terminal is
- Navigate directories
- Display your current location
- Create folders and files
- Remove files and folders safely
- Understand relative vs absolute paths
What is the Terminal?
Unlike Windows, where many tasks are done by clicking icons, Linux administrators spend much of their day in the terminal — typing commands that talk directly to the operating system. Learning the terminal is the single most important Linux skill.
Your First Commands
Print working directory — where am I?
pwd stands for Print Working Directory. It tells you exactly where you are.
List files:
ls # list files
ls -l # long format (permissions, size, date)
ls -la # include hidden filesChange directory:
cd Documents # move into a folder
cd .. # go back one level
cd # return to your home directoryCreating and Removing Things
mkdir linux-practice # create a folder
cd linux-practice # enter it
touch notes.txt # create an empty file
ls # verify it exists
rm notes.txt # remove the file
cd .. # leave the folder
rmdir linux-practice # remove the (empty) folder⚠ rm has no undo
There is no Recycle Bin on the Linux command line. rm deletes immediately and permanently. Double-check the path before you press Enter — especially with rm -r.
Relative vs Absolute Paths
- Relative path — starts from where you currently are:
cd Documents - Absolute path — starts from the root
/:cd /home/student/Documents
Professional engineers use both every day.
Real DevOps Example
When you log into a fresh AWS EC2 server, the first three commands most engineers type are:
These three commands alone are used thousands of times throughout a DevOps career.
🧪 Hands-on Lab
Navigate and Manage Files
Complete the following, in order:
- Create a folder named
practice - Inside it, create a file named
day1.txt - Navigate into the folder and display your location
- List all files
- Delete the file, then delete the folder
💡 DevOps Tip
Don’t try to memorize commands. Use them repeatedly. Within a week your fingers will remember them automatically.
⚠ Common Beginner Mistakes
⚠ Watch Out For These
- Missing spaces:
cdDocumentsis wrong — it’scd Documents. - Case sensitivity:
Documents,documents, andDOCUMENTSare three different names in Linux.
🧠 Knowledge Check
Which command shows your current location?
Which command creates a new directory?
💼 Interview Preparation
What is the difference between an absolute path and a relative path?
Summary
You’ve officially started using Linux from the command line. pwd, ls, cd, mkdir, touch, and rm are the foundation of everything you’ll do in DevOps.