I have seen many articles and posts stating that a way to turn off the system via the terminal is issuing the shutdown -h now
command. It obviously works on my system, but it shuts down everything extremely fast. If I power off the system using Ubuntu's GUI, the Ubuntu splash screen comes up, and it takes much more time before it actually powers down. By safe I am referring to a shutdown that makes sure all read/write operations are completed before powering down and avoiding data corruption.
So is using the shutdown
command in the terminal actually a safe way to power off the system? If so, why does Ubuntu's shutdown menu take much longer to accomplish the same goal?
YES it is safe but...
Shutdown does more than simply flush unwritten data from RAM to disk. In some installations it can be setup to run custom jobs:
But as an answer here points out:
The shutdown
halt
option (designated byshutdown -h
in your question) does flush all the buffers and safely unmount the disks but it doesn't actually turn off the machine. To do that use: