1. Shutdown & Restart commands
Basic introduction
- Shut down immediately.
shutdown -h now
Copy the code
- 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
- Restart your computer now
shutdown -r now
Copy the code
or
reboot
Copy the code
- Shutdown, as above. But instead of shutting down normally, this is shutting down memory
half
Copy the code
or
int 0
Copy the code
- Synchronize memory and data to disk
sync
Copy the code
2. Pay attention to detail
- Whether you reboot or shut down the system, run it first
sync
Command,Writes data in memory to disk - The current
shutdown/reboot/halt
Such commands have been carried out before the shutdownsync