Start up your Mac in single-user mode
To troubleshoot your computer’s startup sequence using only UNIX commands, start up in single-user mode. You should do this only if you’re comfortable with UNIX.
On your Mac, choose Apple menu > Restart, or press the power button if your Mac is turned off.
Press Command-S as your Mac starts up.
The screen is black with standard white text. You can now run the UNIX commands that you want.
In single-user mode, not all macOS functions are available. To use the standard macOS interface or other high-level aspects of macOS, you need to start up in the standard mode.
To switch back to the standard macOS interface, type reboot, then press Return.