What is the Ubuntu shutdown command?

On Ubuntu, the following command can be used to shut down the computer:

  1. shutdownOrder

    sudo shutdown -h now
    

    This command shuts down the system immediately. -hThe option to have the system power off after shutdown nowmeans to do it immediately.

    You can also set the system to shut down at a certain time, for example after 10 minutes:

    sudo shutdown -h +10
    
  2. poweroffOrder

    sudo poweroff
    

    This command also shuts down the system immediately.

  3. haltOrder

    sudo halt
    

    This command stops all CPU functions, but does not turn off the power on some systems.

  4. initOrder

    sudo init 0
    

    initcommand is used to change the runlevel, where 0is the runlevel used for shutdown.

Note that these commands require administrator privileges to execute, so we prepend them sudo.

Before performing any system shutdown commands, it is recommended to save all open files and close all running applications to prevent data loss.

Guess you like

Origin blog.csdn.net/m0_57236802/article/details/131885025