]> git.ipfire.org Git - thirdparty/systemd.git/commit
journalctl: support --lines=+N for showing the oldest N entries
authorMike Yuan <me@yhndnzj.com>
Thu, 10 Aug 2023 17:41:03 +0000 (01:41 +0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 16 Aug 2023 12:05:19 +0000 (14:05 +0200)
commit8d6791d2aa98c989101f572278e9b0a63edfec42
treee7ffdd30193296711f203a0f127886b1d96dd951
parentd40118264395bd0adede3aa5930b212dd63237aa
journalctl: support --lines=+N for showing the oldest N entries

After f58269510727964cb5c10e7d2f9849c442ea1f80, the wrong behavior
occurred when --since= and --lines= are both specified is fixed.
However, it seems that the old behavior is already being somewhat
widely used, and the function itself makes sense, i.e. to allow --lines=
to output the first N journal entries.

Therefore, let's support prefixing the number for --lines= with '+',
and provide such functionality.

Related: #28746
man/journalctl.xml
src/journal/journalctl.c