Systemctl status always shows full log, even with --lines
The command systemctl status
display the status of the service and the corresponding lines from journalctl
, the --lines=3
will limit the displayed number of lines from the journal to 3. e,g:
systemctl --user status resilio-sync --lines=0
will display only the status of esilio-sync
service without the journalctl
log.
-n, --lines=
When used with status, controls the number of journal lines to show, counting from the most recent ones. Takes a positive integer argument, or 0 to disable journal output. Defaults to 10.
To limit the output of the systemctl status
command you can use options:
systemctl check resilio-sync
systemctl is-active resilio-sync
systemctl is-enabled resilio-sync
or by groupping the options:
systemctl is-active is-enabled resilio-sync
This is what the head command was designed for.
systemctl --user status resilio-sync | head -n 3