14

What is the difference between the shutdown menu item and shutdown -h now? The former sometimes hangs up my laptop on Ubuntu 11.10.

11

The shutdown menu item requests the graphical system to shutdown cleanly. Programs that have files to save, for example, have an opportunity to ask the user what to do.

shutdown -h now (synonym: poweroff; see also reboot) merely sends signals to all running programs. They don't have a chance to query the user if they have unsaved files. However, sending the poweroff command will work in more situations because of this.

  • Thanks very much. I didn't know about the difference in saving of files for open programs, it now makes sense to me. – 719016 Dec 9 '11 at 10:12
  • @Scott Severance - You say it's a synonym, but then you say "poweroff command will work in more situations because of this". But because of what ? With poweroff, does programs will have a chance to query the user? – trogne Sep 4 '17 at 20:58
  • What does shutting down cleanly involve if not sending signals to all running programs? – Lightness Races in Orbit Mar 2 '18 at 10:21
  • With CLI commands, graphical programs have no opportunity to query the user about saving open files, for example. So there really are two different types of clean shutdowns. – Scott Severance Mar 2 '18 at 14:10
5

The menu calls a complicated set of freedesktop.org specifications that shut down the system without the user needing to be root. You can see some of these on this answer. This method checks for open documents and blocking applications in the graphical interface before eventually calling for a system halt (via shutdown).

Running shutdown directly just shuts the computer down - regardless of what's running.

If the first isn't working, there's probably something blocking it. I'm not an expert in how it works so I suggest you file a bug on LaunchPad and let somebody who does know how it works step you through the debug process.

0

shutdown the system in a safe way. You can shutdown the machine immediately, or schedule a shutdown using 24 hour format.

After bringing down the system, shutdown command halts or reboots the system according to the option that is specified. Only root user can execute shutdown command

-r  Requests that the system be rebooted after it has been brought down
-h  Requests that the system be either halted or powered off after it has been broughtdown, with the choice as to which left up to the system
-H  Requests that the system be halted after it has been brought down
-P  Requests that the system be powered off after it has been brought down
-c  Cancels a running shutdown. TIME is not specified with this option, the firstargument is MESSAGE
-k  Only send out the warning messages and disable logins, do not actually bring thesystem down
  • 4
    This doesn't answer the question. – Scott Severance Dec 9 '11 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.