C

Linux › Module 2 › Lesson 1

BeginnerModule 2Lesson 1/5

Navigation (ls, cd, pwd, mkdir)

Master ls, cd, pwd, and mkdir to move around Linux like a pro

15 min+40 XP3 quiz
Module progress1 of 5

Opening

You cannot hack what you cannot find

Before you run scanners or read logs, you need to move. Four commands—pwd, ls, cd, mkdir—are how every Linux session starts. They take thirty seconds to learn and years to use without thinking.

1. Where Am I? pwd

pwd means "print working directory." It answers: what folder am I in right now? Example: pwd → /home/analyst

2. What Is Here? ls

ls lists files and folders in the current directory. Common options: ls — simple list ls -l — long format (permissions, owner, size, date) ls -a — show hidden dotfiles ls -lah — long + hidden + human-readable sizes

Security habit

After SSH-ing into a server, run pwd and ls before touching anything. Know where you are so you do not delete the wrong folder.

3. Go Somewhere: cd

cd changes directory. cd Documents — into a subfolder cd .. — up one level cd ~ — your home directory cd /var/log — absolute path from root

4. Create a Folder: mkdir

mkdir makes a new directory. mkdir notes mkdir -p projects/lab1/reports — creates parent folders too (-p)

5. Put It Together

A typical session: pwd ls -la mkdir cyberlium-lab cd cyberlium-lab pwd → /home/you/cyberlium-lab

Knowledge Check

1

Which command shows your current directory?

Multiple choice

Knowledge Check

2

What does cd .. do?

Multiple choice

Knowledge Check

3

Which ls flag shows hidden files (names starting with .)?

Multiple choice

← Previous

Answer all 3 knowledge checks to continue. (0/3 answered)