

To switch to rescue mode for troubleshooting, type the following: # systemctl rescue To switch to multi-user.target without changing the default from graphical.target, type the following: # systemctl isolate multi-user.target 6. To change the current default from multi-user.target (CLI) to the GUI target, type the following: # systemctl set-default graphical.target 5. To display the current default, type the following: # systemctl get-default 4.

In many cases, however, admins may prefer the GUI (graphical.target). It's common for Linux servers to boot to the command-line interface (CLI), which, in systemd's terminology, is the multi-user.target setting. To initiate a shutdown process based on advanced configuration and power interface, type the following: # systemctl poweroff 3. To reboot, type the following: # systemctl reboot 2. Two fundamental tasks for systemctl are rebooting and shutting down the server. For systemctl, this includes shutdown and startup options. In this context, system management refers to the OS configuration. Īdmins use systemctl for two primary reasons: system management and service management. In that case, admins may need to precede the following commands with sudo. Note: Many modern Linux distributions disable the root user account. This displays the complete list of subcommands. To see all available subcommands, try this trick: Type systemctl, press the spacebar once and then press the Tab key twice (normal Bash tab completion). Many systemctl subcommands exist, and this article covers only a handful. The syntax is the following:įor example, to restart a service, type the following: A quick syntax reviewįirst, let's recap the proper use of the systemctl command. Here are 20 ways of using the systemctl command to better understand and administer Linux systems.
