How to Systemd - quick collection

How to Systemd - quick collection
systemd-logo i think the correct colors :D

Switching boot target to text in debian linux

Get target: (graphical.target)

systemctl get-default

Get More infos:

# ls -l /etc/systemd/system/default.target (OR)
# ls -la /usr/lib/systemd/system/default.target
# lrwxrwxrwx 1 root root 16 Jul  8  2021 /usr/lib/systemd/system/default.target -> graphical.target

# systemctl list-units --type target
# list all loaded units in any state #
systemctl list-units --type target --all

To change boot target to the text mode:

systemctl set-default multi-user.target # && reboot

Runlevel: (systemd / sysV (init))

Systemd target                          Runlevel    Description                                             Old command 
runlevel0.target, poweroff.target       0           Power off the Linux box.                                init 0      
runlevel1.target, rescue.target         1           Boot into emergency rescue mode (single user mode).     init 1      
runlevel2.target, multi-user.target     2           Text based multi-user system that no network            init 2      
runlevel3.target, multi-user.target     3           Starts the system normally in multi-user text mode      init 3      
runlevel4.target, multi-user.target     4           For special purposes text mode.                         init 4      
runlevel5.target, graphical.target      5           Same as runlevel 3 and boot into GUI display manager.   init 5      
runlevel6.target, reboot.target         6           Reboot the Linux desktop or laptop.                     init 5      

systemd isolate to the new command X.target

How to boot in to rescue mode

sudo systemctl rescue

Switch to different systemd target unit in session:

systemctl isolate multi-user.target

# Or to change GFX mode:

systemctl isolate graphical.target

Show started services and determine a simulation:

systemd --test --system --unit=graphical.targetsystemd --test --system --unit=multi-user.target