Free space

2 snippets across 2 stacks — Bash & Linux, Docker

SHBash & Linux

Disk Space Usage

SH · System Info
syntax
df [options] [filesystem]
example
df -h
df -h /
df -hT
output
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda1      ext4   50G   32G   16G  67% /
/dev/sdb1      xfs   200G  145G   55G  73% /data

Note -h for human-readable sizes. -T shows filesystem type. -i shows inode usage (you can run out of inodes even with free space if you have millions of tiny files). Check df regularly on servers to prevent disk-full outages.

DKDocker

System-Wide Cleanup

DK · Debugging
syntax
docker system prune [options]
example
docker system prune
docker system prune -a --volumes
output
Total reclaimed space: 5.7GB

Note Without flags: removes stopped containers, unused networks, dangling images, and build cache. With -a: also removes all unused images (not just dangling). With --volumes: also removes unused volumes. This is the nuclear option — it can delete data you care about.