Linux – Why do we need the reboot function in different binaries

historylinuxshutdown

Why do we need the reboot function in different binaries?

shutdown -r

and

reboot

Or do they differ in something?

Best Answer

We don't necessarily need them both, but we have them both because of the history of Unix, and its multiplicity of versions.

From their respective man pages:

  • The shutdown utility appeared in 4.0BSD.
  • A reboot utility appeared in Version 6 AT&T UNIX.

shutdown is more general-purpose, and more powerful, while reboot is friendlier and easier to remember.

shutdown allows you to specify a temporal argument (to restart in 5 minutes, for instance) and allows you to do many things besides reboot, including:

  • you can just kick off users and not actually shutdown
  • you can put the system to sleep instead of shutting down
  • you can simply shutdown without rebooting (like the halt command)
  • you can include a custom warning message for users on the system

However, if you just want to reboot the system now, it's easier to type reboot than shutdown -r now.