62

Usually I use tail -f /var/log/messages to get updates if there are new lines.

How to have the similar functionality for journalctl?

1 Answer 1

88

You can use the -f or --follow switch to tail the logs.

-f, --follow
    Show only the most recent journal entries, and continuously print new 
    entries as they are appended to the journal.

Example

$ sudo journalctl -f
-- Logs begin at Sat 2013-12-07 21:11:30 EST. --
May 14 18:16:34 somehost.somedom.com systemd[1]: Starting Fingerprint Authentication Daemon...
May 14 18:16:34 somehost.somedom.com systemd[1]: Started Fingerprint Authentication Daemon.
May 14 18:16:34 somehost.somedom.com fprintd[12553]: Launching FprintObject
May 14 18:16:34 somehost.somedom.com fprintd[12553]: ** Message: D-Bus service launched with name: net.reactivated.Fprint
May 14 18:16:34 somehost.somedom.com fprintd[12553]: ** Message: entering main loop
May 14 18:16:37 somehost.somedom.com sudo[12552]: saml : TTY=pts/2 ; PWD=/home/saml ; USER=root ; COMMAND=/bin/journalctl -f
May 14 18:16:40 somehost.somedom.com gnome-session[1787]: 18:16:40 | Listener | Trying to reconnect to tcp://notifications.sparkleshare.org:443/
May 14 18:16:44 somehost.somedom.com sudo[12582]: saml : TTY=pts/2 ; PWD=/home/saml ; USER=root ; COMMAND=/bin/journalctl -f -n 10
May 14 18:16:45 somehost.somedom.com gnome-session[1787]: 18:16:45 | Listener | Disconnected from tcp://notifications.sparkleshare.org:443/: ...d block
May 14 18:16:45 somehost.somedom.com gnome-session[1787]: 18:16:45 | personal_repo | Falling back to regular polling
May 14 18:17:04 somehost.somedom.com fprintd[12553]: ** Message: No devices in use, exit

References

3
  • 2
    it seems like that disables the pager, would like to have both...
    – Ben Creasy
    Commented Oct 8, 2017 at 6:23
  • 1
    @Ben Creasy $ journalctl -f --since yesterday , $ journalctl -f -n 1000
    – engineerX
    Commented Jul 22, 2019 at 11:45
  • 6
    journalctl --follow --no-tail --no-tail is used when you want all previous lines (better than -n 100000 or arbitrary big line count) Commented Sep 5, 2019 at 8:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .