Linux › Module 2 › Lesson 1
Navigation (ls, cd, pwd, mkdir)
Master ls, cd, pwd, and mkdir to move around Linux like a pro
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
Which command shows your current directory?
Multiple choice
Knowledge Check
What does cd .. do?
Multiple choice
Knowledge Check
Which ls flag shows hidden files (names starting with .)?
Multiple choice