The systemctl
command may be used to introspect and control the state of the "systemd" system and service manager. Please refer to systemd(1) for an introduction into the basic concepts and functionality this tool manages.
Command | Use |
---|---|
systemctl start sshd |
Starts the sshd daemon (ssh server) |
systemctl stop sshd |
Stops the sshd daemon. If still enabled, this will mean that it will restart when a reboot occurs |
systemctl enable sshd |
This will set the sshd daemon to start on boot, but does not start it immediately |
systemctl enable --now sshd |
Enables the sshd service to start automatically on boot and immediately starts it. This command combines two actions:
|
systemctl status |
Displays the overall system status, including information about active and inactive units (services, sockets, targets, etc.). This command provides a summary of the current state of the system's services and their associated processes. |
systemctl list-unit-files --state=enabled |
Lists all enabled unit files in the system, including services, sockets, and targets. This command provides a comprehensive overview of the units that are set to start automatically during system boot. |
systemctl set-default multi-user.target |
Sets the default boot to CLI |
systemctl isolate multi-user.target |
Switches immediately to CLI mode only |
/var/log/journal
journalctl --disk-usage
SystemMaxUse
setting in /etc/systemd/jourald.conf
e.g. SystemMaxUse=100M
to set to 100 megabytesRequires the journald service to be restarted
systemctl restart systemd-journald.service
to restart