Back to commands

Hosting Operations

Read-only

Summarize Docker Disk Usage

The host disk is full and you need a safe storage summary before cleanup.

Command

docker system df -v

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not treat reclaimable space as safe to delete until you verify ownership and backups.

Expected output

A Docker disk usage summary with reclaimable space estimates.

System impact

Read-only. Nothing changes. Docker reads storage accounting data.

Recovery / rollback: no state is changed.

When to use it

Use before cleanup decisions to understand whether images, containers, volumes, or build cache are responsible.

When not to use it

Do not treat reclaimable space as safe to delete until you verify ownership and backups.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ docker system df -v

TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          8         3         2.8GB     1.1GB (39%)
Containers      5         2         240MB     180MB (75%)
Local Volumes   4         3         1.7GB     200MB (11%)
Build Cache     12        0         620MB     620MB

$ docker volume ls

DRIVER    VOLUME NAME
local     app_postgres_data
local     app_uploads
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. docker system df -v
  2. docker volume ls

next steps

Related commands

Hosting Operations Read-only

Check Bytes and Inodes Before Cleanup

No space left can mean full bytes, full inodes, or both.

df -h /lab/disk-inode-cleanup && df -ih /lab/disk-inode-cleanup
Hosting Operations Read-only

Check Container Health Status

Docker may say a container is running while its health check says otherwise.

docker inspect --format '{{.Name}} health={{if .State.Health}}{{.State.Health.Status}}{{else}}none{{end}} status={{.State.Status}}' web
Hosting Operations Can be slow

Show Containers in a Clean Triage Table

Turn noisy docker ps output into the few fields operators scan first.

docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}\t{{.Ports}}'
Hosting Operations Read-only

Snapshot Container CPU and Memory

Get Docker resource usage once, without leaving a live dashboard running.

docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}'
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:system-management
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.