Linux Survival Basics
Read-only, can be slowCheck 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.
$ 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
journalctl --disk-usagefree -h
next steps
Related commands
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'
Read Current-Boot Logs for One Service
Ignore stale logs and inspect only what happened since this boot.
journalctl -u nginx -b --no-pager -n 80
Check Memory Pressure Quickly
See whether memory is actually tight before restarting services.
free -h
Find Which Folder Is Filling the Disk
The disk was full. The fastest clue was the folder, not the file.
du -sh /var/* 2>/dev/null | sort -h
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.
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.