LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

journalctl

queries and displays messages from the systemd journal

TLDR

Show all messages with priority level 3 (errors) from this boot
$ journalctl -b -p 3
copy
Follow new messages (like tail -f)
$ journalctl -n 50 -f
copy
Show all messages by a specific unit
$ journalctl -u [unit]
copy
Filter messages within a time range
$ journalctl --since yesterday --until today
copy
Show all messages by a specific process
$ journalctl _PID=[pid]
copy
Grep for a pattern in log messages
$ journalctl -g "[pattern]"
copy
Delete journal logs older than 2 days
$ journalctl --vacuum-time=2d
copy
Show messages by a specific executable
$ journalctl [path/to/executable]
copy

SYNOPSIS

journalctl [-b] [-p priority] [-u unit] [-n lines] [-f] [-S since] [-U until]

DESCRIPTION

journalctl queries and displays messages from the systemd journal. The journal stores log data from the kernel, system services, and applications in a structured, indexed format.

PARAMETERS

-b, --boot

Show messages from current boot (or specified boot)
-p, --priority level
Filter by priority (0=emerg to 7=debug, or names)
-u, --unit unit
Show messages from specified systemd unit
-n, --lines n
Show the most recent n lines
-f, --follow
Follow new messages as they appear
-S, --since time
Show entries after specified time
-U, --until time
Show entries before specified time
-k, --dmesg
Show kernel messages only
-r, --reverse
Reverse output (newest first)
-o, --output format
Output format (short, verbose, json, cat, etc.)
--vacuum-time time
Remove journal files older than time
--vacuum-size size
Reduce journal to specified size
-g, --grep pattern
Filter entries by regular expression (PCRE2)
--no-pager
Do not pipe output into a pager
--list-boots
Show a list of boot IDs with timestamps
--disk-usage
Show current disk usage of journal
_PID=pid
Filter by process ID
_SYSTEMD_UNIT=unit
Filter by systemd unit

INSTALL

sudo apt install systemd
copy
sudo dnf install systemd
copy
sudo pacman -S systemd
copy
sudo zypper install systemd
copy
brew install systemd
copy
nix profile install nixpkgs#systemd
copy

CAVEATS

Journal files are stored in /var/log/journal/ (persistent) or /run/log/journal/ (volatile). Some options require root privileges.

HISTORY

Part of systemd, introduced in 2011 by Lennart Poettering. Replaces traditional syslog for systems using systemd.

SEE ALSO

dmesg(1), systemctl(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid