Back to commands

Linux Survival Basics

Read-only, can be slow

Check systemd Journal Disk Usage

Disk alerts often lead people to delete the wrong files without checking whether the systemd journal is the real consumer.

Command

journalctl --disk-usage

Before you run this

System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.

When not to use it: Do not use it to find application log directories outside journald.

Expected output

Archived and active journals take up a measured amount of disk.

System impact

Read-only, can be slow. Nothing changes. journalctl reports the total disk used by archived and active journal files.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use during disk-space triage before deciding whether journal retention needs adjustment.

When not to use it

Do not use it to find application log directories outside journald.

Watch this command run

Command transcript

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

demo@lab:~$

$ journalctl --disk-usage

Archived and active journals take up 412.8M in the file system.

$ free -h

               total        used        free      shared  buff/cache   available
Mem:           1.9Gi       1.3Gi       120Mi        12Mi       420Mi       390Mi
Swap:          2.0Gi       128Mi       1.9Gi
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. journalctl --disk-usage
  2. free -h

next steps

Related commands

Linux Survival Basics Can be slow

Spot OOM Kills in the Kernel Journal

Exit code 137 often means the kernel has something to say.

journalctl -k --since "2 hours ago" --no-pager -o short-iso | grep -Ei 'out of memory|oom|killed process'
Linux Survival Basics Can be slow

Find the Files Eating Your Disk

The disk was full, but guessing at folders was the slow part.

find /var -type f -printf '%s %p\n' | sort -nr | head -20
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:101-system-architecture
  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lpic1:108-essential-services
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:provisional
  • linuxplus:services-users
  • linuxplus:system-management
  • linuxplus:troubleshooting
  • 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.