Skip to content
FR EN

Free up disk space on Linux

Time 8 min Level Intermediate Updated

The usual causes of a full disk on Linux are the apt cache, system logs and old Snap package revisions.

  1. Check available space

    df -h /
    bash

    Look at the Use% column. Above 90%, it's time to clean up.

  2. Find the largest folders

    du -h --max-depth=1 ~ | sort -hr | head -15
    bash
  1. Clear the apt cache

    sudo apt clean
    sudo apt autoremove --purge -y
    bash
  2. Shrink system logs

    sudo journalctl --vacuum-size=200M
    bash
  3. Limit old Snap revisions

    Snap keeps several versions of each app. Keep only the last two:

    sudo snap set system refresh.retain=2
    bash
Read next