brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: journalctl --no-hostname removes the host name from every line

Journalctl
~/tips/tip-journalctl-no-hostname-short-lines

journalctl --no-hostname -u ssh -n 5

Leaves the host name out of the short log lines to save space.

On a single machine the host name repeats on every line and takes up space I would like to use for the message.

--no-hostname drops the host name field from the short output formats. Lines get shorter, and long messages wrap less often in a narrow terminal or in a pasted snippet.

journalctl --no-hostname -u ssh -n 5

It only changes the header of the line. A host name that appears inside the message itself stays, so it is no way to anonymise a log before you share it.

Further reading: journalctl(1) manual page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link