Hacker News new | ask | show | jobs
by hn8305823 1040 days ago
> shutdown -r now

I know this is in lots of textbook examples but I didn't think anyone ever actually typed this. I've always used 'halt' or 'reboot'

3 comments

Using 'halt' or 'reboot' won't run all the scripts needed to shut down cleanly, the correct command to use is 'shutdown -r now'.
IIRC, 'reboot' is aliased to 'shutdown -r now' in several modern distros
reboot and halt have a history of being less graceful on some systems, and I've been bitten. For FreeBSD, I think reboot skips shutdown scripts, doesn't notify all terminals, etc; just kill everything, sync the disk and reboot.

That's not ungraceful, but it's not exactly pleasant.

OTOH, my openwrt device doesn't have a shutdown binary, just a reboot binary.

I use "shutdown -r now" instead of "reboot" because "halt" or "reboot" is not universally available, but shutdown mostly is.