= GUI-or-CLI - Interfacce GUI e CLI per Linux Sottotitolo documento :authors: Celestino Amoroso :docinfo: shared :encoding: utf-8 :toc: right :toclevels: 4 :toc-title: Indice Generale :icons: font :icon-set: fi :numbered: :table-caption: Tabella :figure-caption: Diagramma :docinfo1: :sectlinks: :sectanchors: :source-highlighter: rouge // :rouge-style: ThankfulEyes :rouge-style: gruvbox // :rouge-style: colorful //:rouge-style: monokay toc::[] ## Switch between GUI and CLI To switch to text mode (also known as command-line interface or CLI) in systemd-based systems, you can use systemctl `set-default multi-user.target` to permanently change the default boot target. Alternatively, you can temporarily switch to text mode using `systemctl isolate multi-user.target`. Here's a breakdown of how to switch to text mode: ### 1. Checking the Current Default Target* First, it's helpful to know what your current default target is. You can check this with: systemctl get-default This command will display the current default target, which is likely `graphical.target` if you're currently in a graphical environment. ### 2. Permanently Switching to Text Mode (Multi-User Target) To make text mode the default target on boot, use the following command: sudo systemctl set-default multi-user.target After running this command, you will need to reboot your system for the change to take effect: sudo systemctl reboot Now, when your system starts, it will boot directly into text mode. ###3. Temporarily Switching to Text Mode (Using isolate) If you want to switch to text mode without changing the default, you can use the isolate command: sudo systemctl isolate multi-user.target This command will immediately switch your system to text mode without requiring a reboot. However, the next time you boot, it will revert to the default target (which you can set using set-default as described above). ### 4. Switching Back to Graphical Mode To switch back to graphical mode, you can use the following command (if you previously used set-default): sudo systemctl set-default graphical.target And then reboot: sudo systemctl reboot Or, if you used isolate, you can switch back with: sudo systemctl isolate graphical.target ## Important Notes ### multi-user.target This target represents a system with networking enabled but without a graphical interface (X server or Wayland). ### graphical.target This target represents a system with a graphical interface. ### Reboot When changing the default target, a reboot is necessary for the change to be applied. ### Temporary changes Using isolate provides a temporary change that is not persistent across reboots. ### Closing Applications Switching to text mode will terminate any running graphical applications. Make sure to save your work before switching. ''' *Celestino Amoroso* + *celestino . amoroso @ gmail . com* image::https://gravatar.com/avatar/88d204d546890e5d89073fb1cec29fe9.png?size=48[]