Does the command reboot
(used in Terminal) hurt the computer? Because it is almost like pulling the power cord, which is not a recommended way to power down a computer.
1 Answer
It’s not like pulling the power plug because it sends various signals like SIGTERM
which closes services and daemons. User applications with unsaved data may get lost, but they’re not arbitrarily closed as if the system lost power.
From the man page (man reboot
)
The halt and reboot utilities flush the file system cache to disk, send all running processes a SIGTERM (and subsequently a SIGKILL) and, respectively, halt or restart the system.
So, running reboot
is perfectly safe to the system.
-
This is not the same as the shutdown command which will stop services in order– user44764Commented May 4, 2020 at 6:45
-
3
-
8Reboot flushes to disk, so you may lose unsaved changes, but it's impossible to get filesystem corruption. Commented May 4, 2020 at 14:47
-
15🤔 Strange stuff in this old source code...
void die_you_gravy_sucking_pig_dog(void);
– jtbandesCommented May 4, 2020 at 20:26 -
2
/sbin/reboot
command is actually called by macOS as part of the reboot process.reboot
in the terminal doesn't seem to include the steps that gracefully shut down the apps