1. Shutdown & Restart commands

Basic introduction

  1. Shut down immediately.
shutdown -h now
Copy the code
  1. Turn it off when prompted: “Hello, this will be off in 1 minute”
shutdown -h 1 "Hello, it will be off in a minute."
Copy the code
  1. Restart your computer now
shutdown -r now
Copy the code

or

reboot
Copy the code
  1. Shutdown, as above. But instead of shutting down normally, this is shutting down memory
half
Copy the code

or

int 0
Copy the code
  1. Synchronize memory and data to disk
sync
Copy the code

2. Pay attention to detail

  1. Whether you reboot or shut down the system, run it firstsyncCommand,Writes data in memory to disk
  2. The currentshutdown/reboot/haltSuch commands have been carried out before the shutdownsync