We can work with boot targets using the systemctl command. We touched on systemctl earlier in this chapter. Let's use the Ubuntu distribution. We can check which target is currently the default and running in the shell in real time by doing the following:
philip@ubuntu:~$ systemctl get-default
graphical.target
philip@ubuntu:~$
From the preceding output, we can see that graphical.target is the default running target. Now, if we want to change between targets, we can use the systemctl command. Let's change to multi-user.target:
philip@ubuntu:~$ systemctl isolate multi-user.target
As soon as we press the Enter key, the system will ask us to authenticate:
We can also run systemctl to verify the status of multi-user.target:
We can return the system to the GUI environment by using the systemctl command:
Also, we can take a look at one of the targets...