# Filesystem & Navigation — Linux

Source: https://www.geekswithgeeks.com/en/linux/linux-navigation-basics

> The directory tree, and the commands to move around it.

## The filesystem hierarchy

Linux has a single tree rooted at `/`. Key directories: `/home` (user files), `/etc` (config), `/var` (logs, variable data), `/bin`/`/usr/bin` (programs), `/tmp` (temporary files).

## pwd, ls, cd

`pwd` prints where you are, `ls` lists contents, `cd` changes directory.

```bash
pwd
ls
cd /etc
ls -la
```

Output:

```
/home/alice
Documents  Downloads  notes.txt
/etc
drwxr-xr-x  2 root root 4096 Sep  4 09:00 .
-rw-r--r--  1 root root  120 Sep  4 09:00 hostname
```

## Handy ls flags

`ls -l` long format, `ls -a` shows hidden files (starting with `.`), `ls -lh` human-readable sizes. Combine: `ls -lah`.
