Q1Which command shows the path of the directory you're currently in?
Terminal Basics — pwd, ls, cd
Take your first steps in the Linux terminal — pwd for where you are, ls to list, cd to move — running a real Linux environment live in a browser terminal.
About the Linux in this course
This course covers the universal command-line operations shared across major distributions like Ubuntu, Debian, and CentOS.
Basics like cd / ls / cp / mv / grep and pipes work the same way on any Linux server.
The browser terminal uses Buildroot Linux (busybox) because of technical constraints.
Whenever a detail differs between distributions (a few options, or how help is read), we'll show the other environments side by side, like here's how you write it on Ubuntu.
What are Linux and the terminal?
Linux is an OS that runs on servers, cloud platforms, and embedded devices all over the world.
With the terminal (the command line), you can handle file operations, run programs, and manage servers using only the keyboard.
It's an essential skill for engineers.
Using the terminal
This terminal runs a real Linux environment (Buildroot Linux).
It takes a moment to boot.
Once the # prompt (the symbol that means it's ready for input) appears, you can type commands.
Drag to select text inside the terminal and it's copied automatically.
Check where you are — pwd
pwd (Print Working Directory) shows the absolute path of the directory you're currently in.
Whenever you lose track of where you are in the file system, run pwd first to check your location.
pwd shows your current location as an absolute path (here, /root).pwd
# e.g. /root
List files — ls
ls lists the contents of a directory.
Add -l for a detailed view showing permissions, size, and modification time, and add -a to also show hidden files whose names start with ..
The combined ls -la is the one you'll use most.
-l gives a detailed view; -a also shows hidden files starting with ..ls # list
ls -l # detailed view (permissions, size, date)
ls -la # detailed view including hidden files
ls /etc # list a specific directory
ls has several common options that change what it shows.
| Command | What it shows |
|---|---|
ls | Lists names only |
ls -l | Detailed view with permissions, size, and modification time |
ls -a | Also shows hidden files starting with . |
ls -la | Detailed view combined with hidden files |
ls -R | Lists subdirectories recursively |
ls -1 | Lists one entry per line |
Move between directories — cd
cd (Change Directory) moves you between directories.
Use .. to go up one level, ~ for the home directory, and / for the root.
After moving, make a habit of checking where you are with pwd.
The home directory is a dedicated directory provided for each user.
It's the starting point for your work files and personal settings; in this terminal, the root user's /root is the home directory.
~ (tilde) is shorthand for that path, so cd ~ returns you home from anywhere.
cd moves your location. ~ = home, .. = up one, / = root.cd /tmp # move to /tmp
pwd # check current location
cd .. # go up one level
cd ~ # back home
cd / # to the root
Knowledge Check
Answer each question one by one.
Q2What does the ls -la command show?
Q3Where does cd ~ take you?