[ Prev ] [ Index ] [ Next ]

journalctl

Created søndag 04 december 2016


The Journalctl is Arch's logging journal.


Usage

# A few ways to invoke the Journal


Select boot

# You can select which boot you've like to see information from.
$ journalct -b


# -b is the same as -b -0
# To show from previous boot, use -b -1
# And the second previous, -b -2
# etc etc.


Show end of the Jourmal

# Use -x to view the latest entries in the journal
$ journalctl -xb


Display since .. minutes

# Ex to display all messages within the last 20 minutes
$ journalctl --since "20 min ago"


Follow new messages

# To follow the journal for new entries
$ journalctl -f



Tips and Tricks

# Some random Tips and Tricks


Wordwrap the output of journalctl

# By default, journalctl truncates the text (off the terminal display)
# You can instead make it wordwrap the output
$ SYSTEMD_LESS=FRSXMK journalctl


Reduce log size

# We don't want our log to take 5% disc-space.
# Edit /etc/systemd/journald.conf, uncomment and set the SystemMaxUse

SystemMaxUse=50M


# Then reduce the current journal to 50M
$ journalctl --vacuum-size=50M