LM v19.2 How to Boot to a Command Line

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
mik007san
Level 1
Level 1
Posts: 6
Joined: Sat Sep 29, 2018 4:11 pm
Location: Oklahoma

LM v19.2 How to Boot to a Command Line

Post by mik007san » Mon Oct 14, 2019 11:53 am

I haven't found anything useful regarding booting to a command line environment login instead of a GUI login interface. I have tried several suggestions found while searching the web for, "LinuxMint" and "boot to command line environment"; however, these suggestions are relative to older versions of Linux Mint and DO NOT work in version 19.2! These include modifying the /etc/default/grub file following with "update-grub", and modifying the grub line at boot.

There should be a simple way to boot to a command line environment similar to the RHEL/CentOS 'inittab' modifications. Any viable suggestions are appreciated. TIA. -Mike
Last edited by JeremyB on Mon Oct 14, 2019 4:37 pm, edited 1 time in total.

User avatar
zcot
Level 5
Level 5
Posts: 563
Joined: Wed Oct 19, 2016 6:08 pm

Re: LM v19.2 How to Boot to a Comman Line

Post by zcot » Tue Oct 15, 2019 9:35 am

Hello Mike, welcome.

Without getting any more advanced, you can simply use the ctrl + alt + F1 (to F6) key combo at the normal graphical login screen. There are 6 TTY's ready to use there, and tty7 is the graphical desktop session, under the F7 key. You can readily switch between any of them at any time, even from the authenticated desktop session, so you can go back and forth with any as you see fit.

User avatar
JOPETA
Level 15
Level 15
Posts: 5880
Joined: Thu Nov 20, 2014 6:10 am
Location: En un lugar de cuyo nombre no quiero acordarme

Re: LM v19.2 How to Boot to a Comman Line

Post by JOPETA » Tue Oct 15, 2019 12:05 pm

You can try only for one session, editing the default GRUB menu entry (the one that is selected by default) pressing E or TAB key and in the kernel line delete quite splash and write systemd.unit=multi-user.target in that place. Press F10 to boot.

After login in a text session, whenever you want a to get into a GUI session write startx (do not use sudo) . If you want to go back in text mode again just logout from the GUI session. Also you can open another text session with Alt+Ctrl+F2 or F1 and switch between then in the same way (Alt+Ctrl+F1/Alt+Ctrl+F2).

As it is said here, If you want to boot in such text session by default you will need to sudo systemctl set-default multi-user.target. To undo (start in a graphical session by default again) sudo systemctl set-default graphical.target. :wink:
Ni cola de león ni cabeza de ratón, prefiero ser diente de ajo.(Javier Krahe)

User avatar
mik007san
Level 1
Level 1
Posts: 6
Joined: Sat Sep 29, 2018 4:11 pm
Location: Oklahoma

Re: LM v19.2 How to Boot to a Command Line

Post by mik007san » Sun Nov 17, 2019 11:01 am

Here are bash scripts, which will allow one to switch between persistant GUI and CLI interfaces with no worries:

To create a boot to command line

/***Begin ***

Code: Select all

#!/bin/bash
# SetCLIBoot.sh: Creates a command line boot

clear
echo -e "\nThis script reboots your system!\n\n"
read -r -p "Continue? [y/N] " ans1
ans1=${ans1,,}                          # Set input to lower case
if [ "$ans1" != "y" ] && [ "$ans1" != "yes" ]
then
   echo -e "\nExiting\n"
   exit 1
fi

sudo systemctl set-default multi-user.target
sudo reboot

exit 0
***** End ****/

To create a boot to GUI

/***Begin ***

Code: Select all

#!/bin/bash
# SetGUIBoot.sh: Creates a GUI boot

clear
echo -e "\nThis script reboots your system!\n\n"
read -r -p "Continue? [y/N] " ans1
ans1=${ans1,,}                          # Set input to lower case
if [ "$ans1" != "y" ] && [ "$ans1" != "yes" ]
then
   echo -e "\nExiting\n"
   exit 1
fi

sudo systemctl set-default graphical.target
sudo reboot

exit 0
***** End ****/

Have a nice day!
God, make me the kind of person my dog thinks I am.

Post Reply

Return to “Installation & Boot”