# Disk Usage — Linux

Source: https://www.geekswithgeeks.com/en/linux/linux-disk-usage

> df and du show where your space is going.

## df — filesystem space

`df -h` shows free/used space per mounted filesystem, in human-readable units.

```bash
df -h
```

Output:

```
Filesystem  Size  Used Avail Use% Mounted on
/dev/sda1    50G   32G   16G  67% /
```

## du — directory size

`du -sh dir` shows a directory's total size; sort the biggest offenders with `du -sh * | sort -h`.

```bash
du -sh /var/log
du -sh * | sort -h
```

Output:

```
128M    /var/log
```
