Skip to the content.

systemd cheatsheet

systemctl

To view a status of the service:

sudo systemctl status nginx

To restart a service:

sudo systemctl restart nginx

journalctl

To tail the logs of a unit:

sudo journalctl -fu nginx

To tail and view the last 100 logs:

sudo journalctl -fu nginx -n 100 --no-pager