[systemd-devel] Make journalctl start at the end of the journal by default

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Aug 18 07:54:14 PDT 2014

On Mon, Aug 18, 2014 at 04:42:52PM +0200, Lennart Poettering wrote:
> On Mon, 18.08.14 17:19, Philippe De Swert (philippedeswert at gmail.com) wrote:
> > > Moreover, journalctl is frequently now used in scripts, we cannot change
> > > the defaults really now, that would break all scripts. journalctl is API now.
> > 
> > I could argue that most people who use -b might not know about -e, or
> > that scripts would not use default journalctl behaviour. (I actually
> > included a -s option in the patch to have journalctl with the old
> > behaviour) But this will only degrade in a personal preferences game I
> > guess.
> > 
> > > I'd recommend to simple set a shell alias to map "journalctl" to
> > > "journalctl -e" if that's what you prefer. That way you maintain API
> > > compatibility while simplifying what you have to type the way you
> > > prefer. (Actually, you could even map "j" to "journalctl -e", making
> > > things even easier to type).
> > 
> > I did explain I knew what aliases were and why they would not work.
> > Constantly changing environment, needing to make sure something does not
> > magically work on one device due to aliases and not on another etc...
> I think it might make sense to maybe file bugs against a number of
> distros, asking them to maybe set the alias by default, the way many
> distros set shorter aliases by default for some "ls" invocations.
> We could maybe even ship something like that in systemd upstream, but
> afaik there's no standard place we could hook that into bash. 
>     alias jb='journalctl -b'
>     alias je='journalctl -e'
> Doesn't sound too terrible for me to have as suggested default
> aliases...
Many shells use 'j' for and similar things for jobs, autojump uses 'j'
to change directories... I don't think we should try to enter into the
crowded world of short shell aliases.

Also, it seems that there aren't any other commands starting with 'jou',
so 'jou<TAB>' should be enough.

> > >> And also I would like to see the full logs always by default.
> > >> Usually after lots of searching you find the offending log entry for
> > >> the error, only to find out you forgot to pass the right command
> > >> line options to journalctl and the important bit is cut off.
> > > 
> > > cut off? You can just scroll to the right in most pagers, such as less?
> > 
> > Good luck doing that when you don't have arrow keys available. Moreover
> > I still believe wrapping would be more useful. But personal preferences
> > again I guess.
> I am pretty sure doing the auto-paging thing (the same way as git, and
> others do it) improves end-user experience for most people. I mean, I
> think having arrow keys is the common case. Not having them is the rare
> exception...
You can say -S<enter> in less to instruct it to wrap lines.

For me, the only conclusion from this thread is that we should expand
the EXAMPLES chapter in journalctl(1) to deal more with pipes and common


More information about the systemd-devel mailing list