All tags
Start here · journalctlFind out why a Linux service failed, with journalctl12 steps · 13 min read · Linux server owners who rarely read logsStart the guide journalctl
Narrow down
Guides1
Shell89
- Tip
journalctl -k -g 'killed process' --since "2 days ago"journalctl -k -g finds which process the OOM killer tookFind out which program the kernel killed when memory ran out.30 Nov 2026 - Tip
journalctl _PID=1 -bjournalctl _PID=1 shows only what systemd itself saidRead the service manager's own messages about starts, stops and failures without the services' chatter.30 Nov 2026 - Tip
ls -lh /var/log/journal/*/*.journal~Journalctl still reads the .journal~ files that journald set asideUnderstand the journal files with a tilde at the end and read them when needed.30 Nov 2026 - Tip
Storage=volatileStorage=volatile keeps the journalctl log in RAM onlyStop journald from writing logs to an SD card or other fragile storage.30 Nov 2026 - Tip
sudo journalctl --setup-keysJournalctl setup-keys seals your logs so tampering shows upMake later changes to stored journal files detectable with a key you keep elsewhere.30 Nov 2026 - Tip
journalctl -F _KERNEL_SUBSYSTEMjournalctl _KERNEL_SUBSYSTEM=usb shows what the kernel said about USB devicesFilter kernel and udev messages to one kind of hardware, like USB or PCI.30 Nov 2026 - Tip
journalctl -t demoapp -n 1 -o json-seq | od -c | head -1journalctl -o json-seq writes records that survive a cut off streamGet JSON records with a clear start marker, so a half written line can be skipped.30 Nov 2026 - Tip
sudo mkdir -p /etc/systemd/journald.conf.dMaxRetentionSec in journald.conf caps how old journalctl history getsMake journald delete old log files after a fixed age, whatever the disk size.30 Nov 2026 - Tip
journalctl -u nginx -e -n 5000journalctl -e loads only the last 1000 lines unless you ask for moreScroll further back after jumping to the end of the journalctl pager.30 Nov 2026 - Tip
SYSTEMD_COLORS=1 journalctl -b -p warning | less -RSYSTEMD_COLORS=1 keeps journalctl colors when you pipe the outputKeep the red errors and yellow warnings when journalctl output goes through grep or less.30 Nov 2026 - Tip
sudo journalctl --rotateJournalctl rotate makes vacuum delete the current file tooArchive the active journal file first so a cleanup can actually remove its data.30 Nov 2026 - Tip
SYSTEMD_LESS=FRXMK journalctl -u nginxSYSTEMD_LESS changes how the journalctl pager behavesMake the journalctl pager wrap long lines instead of cutting them off at the screen edge.30 Nov 2026 - Tip
journalctl -N | sortjournalctl -N lists every field name your journal usesSee which field names exist before you write a match on the journalctl command line.30 Nov 2026 - Tip
journalctl -b -1 -n 50journalctl -b -1 -n 50 shows how the last boot endedRead the final lines before a reboot or crash to see whether it was a clean shutdown.30 Nov 2026 - Tip
journalctl -u 'php*-fpm.service' --since todayjournalctl -u takes a wildcard to read a whole family of unitsRead all instances of a template service or every matching unit in one command.30 Nov 2026 - Tip
journalctl -u nginx --since "$(systemctl show -p ActiveEnterTimestamp --value nginx)"journalctl since ActiveEnterTimestamp shows logs from the last service startRead only the log lines since a service last started, without looking up the time.30 Nov 2026 - Tip
journalctl _TRANSPORT=stdout -u myappjournalctl _TRANSPORT=stdout shows what services printed to their terminalSeparate the lines a service printed with echo or print from its proper log calls.30 Nov 2026 - Tip
journalctl _SYSTEMD_SLICE=user-1000.slice --since todayjournalctl _SYSTEMD_SLICE= shows everything one slice loggedRead the logs of every process in one slice, such as one user's session.30 Nov 2026 - Tip
sudo journalctl --relinquish-varJournalctl relinquish-var lets you unmount /var without losing logsMake journald stop writing to /var so the disk can be unmounted cleanly.30 Nov 2026 - Tip
sudo tee /etc/systemd/journald.conf.d/50-filesize.conf <<'EOF'SystemMaxFileSize in journald.conf decides how much journalctl vacuum frees at onceControl the size of each journal file, and with it how coarse cleanups are.30 Nov 2026 - Tip
journalctl _SYSTEMD_UNIT=nginx.servicejournalctl _SYSTEMD_UNIT= skips what systemd said about the serviceShow only lines a service wrote itself, without the start and stop messages from systemd.30 Nov 2026 - Tip
journalctl MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1 -o short-isojournalctl MESSAGE_ID= lists every program that crashed with a core dumpGet a list of crashes from the journal with one fixed message ID.30 Nov 2026 - Tip
journalctl -u nginx.service --cursor-file=/var/tmp/nginx.cursorjournalctl --cursor-file continues where the last run stoppedStores the position of the last log entry in a file so the next journalctl run only shows new lines.28 Nov 2026 - Tip
journalctl -xeu nginx.servicejournalctl -x adds explanation texts to log linesAdds catalog explanation texts under log lines that have one, which helps with failed service starts.28 Nov 2026 - Tip
sudo usermod -aG systemd-journal $USERThe systemd-journal group lets you read every log without sudoRead the system journal as your normal user, without typing sudo every time.27 Nov 2026 - Tip
sudo mkdir -p /etc/systemd/journald.conf.dForwardToConsole in journald.conf puts the live log on a spare ttyShow every new journal line on a spare virtual terminal of the machine.27 Nov 2026 - Tip
sudo systemctl edit myapp.serviceLogFilterPatterns= drops a service's noisy lines before journalctl stores themStop a service's repetitive log lines from being stored in the journal at all.27 Nov 2026 - Tip
journalctl -u backup.service -Ijournalctl -u with -I shows only the latest run of a serviceShows the log lines of only the last run of a service, or the run before it.27 Nov 2026 - Tip
journalctl JOB=nightly-backupLogExtraFields= adds your own field to a service's log lines for journalctlTags the log lines of several services with one field so you can read them together.27 Nov 2026 - Tip
journalctl -b _SYSTEMD_UNIT=ssh.service + _COMM=sudoA lone + in journalctl combines two matches with ORCombines two journal matches with OR instead of AND, so one command shows two sources together.26 Nov 2026 - Tip
journalctl -xb -p errjournalctl -x adds an explanation under the log lines that have oneAdds a short explanation beneath journal entries that have one in the message catalog.26 Nov 2026 - Tip
journalctl --show-cursor -n 20journalctl --show-cursor and --after-cursor continue where you stoppedShows an opaque bookmark after the last line so a later run can continue from there.26 Nov 2026 - Tip
journalctl --cursor-file=/var/tmp/jc.cursor -u myappjournalctl --cursor-file reads only the new entries on every runRemembers where the last run ended in a file, so each run prints only new entries.26 Nov 2026 - Tip
journalctl /dev/sdajournalctl /dev/sda shows kernel messages about one diskShows only the journal entries about one device, such as a failing disk, for the current boot.26 Nov 2026 - Tip
journalctl -D /mnt/backup/var/log/journal -b -1journalctl -D reads the journal of another machine from a copied directoryReads journal files from any directory, for example a disk taken from a machine that no longer boots.26 Nov 2026 - Tip
journalctl -b /usr/sbin/sshdjournalctl /usr/sbin/sshd shows the logs of one program by its pathFilters the journal by a program's file path, which works when you do not know the unit name.26 Nov 2026 - Tip
journalctl -o export > journal.exportjournalctl -o export makes a text-based copy of the journal you can moveWrites journal entries with all their fields to a stream that can be stored or imported elsewhere.26 Nov 2026 - Tip
journalctl --facility=auth,authpriv --since todayjournalctl --facility=auth,authpriv shows only login and security messagesFilters the journal by syslog facility, for example login and privilege messages only.26 Nov 2026 - Tip
journalctl --file='/var/log/journal/*/system.journal' -n 20journalctl --file reads one journal file or a set of them by globReads the entries of specific journal files matching a glob instead of the system journal.26 Nov 2026 - Tip
journalctl -kfjournalctl -kf follows the kernel log liveFollows kernel messages live, handy while you plug in or remove hardware.26 Nov 2026 - Tip
journalctl -u nginx -f --no-tailjournalctl -f --no-tail follows a service and prints its whole history firstPrints all matching entries and then keeps following, instead of starting with the last ten lines.26 Nov 2026 - Tip
journalctl -g timeout -n 5journalctl -g combined with -n shows the newest matches firstCombining a text search with a line count prints the newest matches first, because the order flips.26 Nov 2026 - Tip
journalctl --header | head -20journalctl --header shows what is inside the journal filesPrints the header information of the journal files instead of log entries.26 Nov 2026 - Tip
journalctl -M mycontainer -bjournalctl -M reads the journal of a running local containerReads the journal of a running systemd container from the host by its machine name.26 Nov 2026 - Tip
[Journal]MaxLevelStore in journald.conf stops journald from storing debug messagesMakes journald drop messages above a chosen level before they are stored, such as debug.26 Nov 2026 - Tip
journalctl -m -bjournalctl -m merges the journals of all users and remote sourcesShows entries from all available journals, local and remote, in one time-ordered stream.26 Nov 2026 - Tip
journalctl --namespace=myappjournalctl --namespace reads a separate journal namespaceShows the logs of one journal namespace, or all namespaces at once with a star.26 Nov 2026 - Tip
journalctl --no-full -u myappjournalctl --no-full cuts long log lines to fit your terminalShortens log lines that do not fit the terminal width so a list stays scannable.26 Nov 2026 - Tip
journalctl --no-hostname -u ssh -n 5journalctl --no-hostname removes the host name from every lineLeaves the host name out of the short log lines to save space.26 Nov 2026 - Tip
journalctl -u ssh --no-pager | grep -c Acceptedjournalctl --no-pager sends the output straight to the next commandPrints the output directly instead of opening a pager, which suits scripts and pipes.26 Nov 2026 - Tip
journalctl -n +20journalctl -n +20 prints the oldest 20 entries instead of the newestShows the oldest journal entries, which tells you how far back the history goes.26 Nov 2026 - Tip
journalctl -u myapp -o catjournalctl -o cat prints only the message textPrints just the message text of each entry, without time stamps or host names.26 Nov 2026 - Tip
journalctl -o json --output-fields=MESSAGE,PRIORITY -n 3journalctl --output-fields keeps JSON output to the fields you nameLimits JSON or verbose output to the fields you list, which keeps scripts small and fast.26 Nov 2026 - Tip
journalctl -b -o short-delta -u myappjournalctl -o short-delta shows the gap between each line and the one beforePrints the time since the previous entry on every line, to find long pauses and timeouts.26 Nov 2026 - Tip
journalctl -o short-full -u myappjournalctl -o short-full prints time stamps with weekday, year and time zoneShows complete time stamps that you can paste straight into --since and --until.26 Nov 2026 - Tip
journalctl -b -o short-monotonicjournalctl -o short-monotonic counts seconds since bootPrints seconds since boot as the time stamp, which reads well for startup problems.26 Nov 2026 - Tip
journalctl -o short-unix -u myappjournalctl -o short-unix gives time stamps scripts can calculate withPrints the time as seconds since 1970 so a script can calculate with it.26 Nov 2026 - Tip
journalctl -o with-unit -u 'getty@*'journalctl -o with-unit shows the full unit name in front of each linePrefixes each line with the full unit name, including the instance of templated services.26 Nov 2026 - Tip
journalctl -u nginx -ejournalctl -e opens the pager at the end of the journalStarts the pager at the last entries, limited to 1000 lines of the current boot.26 Nov 2026 - Tip
journalctl -q -b -1journalctl -q hides the — Reboot — lines and permission warningsRemoves journalctl's own informational lines, so only real log entries remain.26 Nov 2026 - Tip
[Journal]RateLimitBurst in journald.conf explains why a chatty service loses log linesExplains and changes the per-service limit that makes journald drop messages in a burst.26 Nov 2026 - Tip
journalctl -r -u sshjournalctl -r puts the newest entries on topReverses the order so the newest journal entry is shown first.26 Nov 2026 - Tip
journalctl --root=/mnt/system -b -1journalctl --root reads the logs of a system mounted under a directoryReads the journal of another system that is mounted under a directory, such as a rescue mount.26 Nov 2026 - Tip
[Journal]RuntimeMaxUse in journald.conf limits a journal that lives in memoryCaps the size of the in-memory journal, which matters on small machines such as a Raspberry Pi.26 Nov 2026 - Tip
journalctl -a -u myservicejournalctl -a shows long or binary fields in fullShows complete log fields, including long ones and ones that normally appear as blob data.26 Nov 2026 - Tip
[Journal]SyncIntervalSec in journald.conf explains why the last lines before a crash may be missingSets how often journald syncs its files to disk, which decides how much a crash can lose.26 Nov 2026 - Tip
sudo journalctl --syncJournalctl --sync makes sure every log line is on disk before you continueForces journald to write all pending log data to disk and returns when it is done.26 Nov 2026 - Tip
[Journal]SystemKeepFree in journald.conf leaves disk space for everything elseTells journald to keep a minimum of disk space free, as a floor next to the size cap.26 Nov 2026 - Tip
journalctl --truncate-newline -u myappjournalctl --truncate-newline shows only the first line of multiline messagesCuts every message after its first line, so long traces do not flood the screen.26 Nov 2026 - Tip
journalctl --since today _UID=$(id -u)journalctl _UID=$(id -u) shows what your own processes loggedShows the journal entries written by processes that run under one user ID, for example your own.26 Nov 2026 - Tip
journalctl --user -u myappjournalctl --user shows the logs of the services in your own sessionShows the logs of services that run in your own user session instead of the system.26 Nov 2026 - Tip
sudo journalctl --vacuum-files=5Journalctl --vacuum-files=5 keeps only five archived journal filesKeeps a fixed number of archived journal files and removes the oldest ones.26 Nov 2026 - Tip
sudo journalctl --vacuum-time=2weeksJournalctl --vacuum-time=2weeks deletes archived journal files older than two weeksRemoves archived journal files older than a chosen time span and reports the freed space.26 Nov 2026 - Tip
journalctl --verifyjournalctl --verify checks the journal files for corruptionChecks every journal file for corruption and reports PASS or FAIL for each file.26 Nov 2026 - Tip
systemd-cat -t backup /usr/local/bin/backup.shsystemd-cat sends a script's output to the systemd journal under its own nameLogs the output of a script or command to the journal with a tag and priority you choose.26 Nov 2026 - Tip
[Journal]SystemMaxUse in journald.conf.d keeps journalctl history within a size limitCaps the size and age of the stored journal permanently with a small config drop-in.24 Nov 2026 - Tip
journalctl -b -p warning..errjournalctl -p warning..err selects a priority rangeSelects log lines between two severity levels, such as warnings up to errors.24 Nov 2026 - Tip
journalctl -t sudo --since todayjournalctl -t sudo lists who ran which command with sudoFilters the journal by program name, for example to review every sudo command.24 Nov 2026 - Tip
journalctl -u nginx -u mariadb --since "30 min ago" -fjournalctl -u twice merges the logs of two services in time orderShows the logs of several services in a single time-ordered stream.24 Nov 2026 - Tip
journalctl -u ssh -g "failed|invalid user" --since yesterdayjournalctl -g searches log messages with a regular expressionFilters journal messages with a regular expression and keeps the timestamps and paging.24 Nov 2026 - Tip
journalctl -F _SYSTEMD_UNITjournalctl -F lists every value a log field has hadLists all unique values of a journal field, so you know what to filter on.24 Nov 2026 - Tip
sudo mkdir -p /var/log/journalA persistent journalctl history needs /var/log/journal to existMakes the journal survive reboots by creating the directory journald uses for disk storage.24 Nov 2026 - Tip
journalctl --disk-usagejournalctl --disk-usage tells you how much space the journal takesReports the total disk space used by the system journal files.24 Nov 2026 - Tip
journalctl -o short-iso -u ssh --since todayjournalctl -o short-iso gives timestamps you can compare across serversPrints log timestamps in ISO 8601 or UTC so logs from different hosts can be compared.24 Nov 2026 - Tip
journalctl -u nginx -n 1 -o json-prettyjournalctl -o json-pretty shows every field of a log entryPrints a full log entry with all its metadata fields, ready for scripting or filtering.24 Nov 2026 - Tip
journalctl -k -b -1journalctl -k -b -1 reads the kernel log of the previous bootShows kernel messages from the previous boot, which dmesg has already lost.24 Nov 2026 - Tip
journalctl -b -2 -u nginxjournalctl --list-boots shows which boots the journal still holdsLists every boot the journal knows, with offsets you can pass to -b.24 Nov 2026 - Tip
journalctl --since "1 hour ago"journalctl --since "1 hour ago" cuts the log down to what just happenedShows only the log lines of the last hour, or any period you give it.23 Nov 2026 - Tip
journalctl --disk-usagejournalctl --vacuum-size caps how much log space you keepShrinks the systemd journal to a size you pick by deleting the oldest logs.16 Jun 2026
Docker2
- Tip
sudo journalctl -b CONTAINER_NAME=webserverJournalctl CONTAINER_NAME= reads one Docker container's logs from the journalSends Docker container logs to the systemd journal and filters them by container name.27 Nov 2026 - Tip
journalctl -u docker -f -n 0journalctl -f -n 0 follows a log and prints only what arrives from now onFollows the journal and shows only new entries, without the usual last ten lines.26 Nov 2026
Nothing matches.