After 1997, the MacOS kernel XNU ("XNU is Not Unix") partially incorporated the Unix-based OS, FreeBSD. Though XNU is not the same as linux, as both are based on Unix, there are some similarities -- hence I stuck this here.
Keyboard shortcuts to be executed when press the power button or when restarting
cmd + v verbose mode: see all system messages during boot up (like in linux OS)
alt + cmd + p + r reset NVRAM (nonvolatile random-access memory) -- incl. sound vol, display res, startup disk selection, time zone, kernel panic info
cmd + s single-user mode (terminal prompt). Disabled in MacOS Mojave and later.
cmd + alt + r internet recovery mode
cmd + r built-in MacOS Recovery mode (not in older MacOS)
If you installed a newer MacOS in an unsupported Mac (like Catalina OS using this patch), and you applied an update or reset the PRAM, you might find your Mac not be able to boot into the Desktop -- it is stuck on the MacOS logo on the gray background during start up. If you reboot in verbose mode to see the boot messages (cmd + v at start up) and see "AMFI sip is off", you need to do the following.
Boot into Mac Recovery mode (alt+cmd+r or cmd+r).
In a terminal, type these commands:
mount -uw /
nvram boot-args="-no_compat_check amfi_get_out_of_my_way=1"
reboot