← Linux & the Command Line tutorial

Linux & the Command Line

Navigating the Filesystem

pwd ("print working directory") shows where you currently are. ls lists what's in the current folder. cd changes directory.

Example: a short session

$ pwd
$ ls -la
$ cd Documents
$ pwd

The -la flags on ls are worth knowing separately: -l switches to a detailed "long" listing (one file per line, with permissions and size, you'll see this format again in the Permissions lesson), and -a includes hidden files (anything starting with a dot, like .gitignore, normally hidden from a plain ls). cd .. goes up one level from wherever you are; cd ~ jumps straight to your home folder no matter how deep you've navigated.

Example
$ pwd
$ ls -la
$ cd Documents
Output
/home/ada
total 12
drwxr-xr-x  3 ada ada 4096 Aug 10 12:00 .
drwxr-xr-x 20 ada ada 4096 Aug 10 11:58 ..
drwxr-xr-x  2 ada ada 4096 Aug 10 12:00 Documents
/home/ada/Documents
Ready to go further?

These free tutorials are a preview, our Cybersecurity cohort covers it in depth, with a real project and a cohort alongside you. Active

Enroll in Cybersecurity
Don't miss out

Ready to build something real?

Create a free account to enroll in a track, and get notified the moment a cohort opens.

Create free account