This quick tutorial teaches you how to shutdown Ubuntu or any other distributions from the Linux command line.
The ways to shutdown Windows 10 are similar to the restart options mentioned above. You can use the Start menu. This does a hybrid shutdown. If you hold down Shift and then press Shut down, then it will do a full shutdown: You can use the Power User/Win + X menu: Again, you can use the 'shutdown' command at the command prompt. Take the shutdown /r and shutdown /g commands, for example. Today's SuperUser Q&A post has the answer to a curious reader's question. I thought that when Windows restarts, every application would be closed during.
There are two ways to shutdown Ubuntu Linux.
- Using the menu (for desktop users)
- Using terminal (for both desktop and server users)
Iâll discuss both methods in this tutorial.
If you use Ubuntu desktop, you would have no problems in finding the shutdown and the restart option located in the top right corner. If you do, you can extend the next section to see what it looks like.
It may depend on the desktop environment but usually, youâll see the option in the top right corner:
If you click on the power-off button, it will give you three options: Cancel, Restart and Power Off. You can choose the one you want.
This article is specifically focused on Ubuntu server editions. You are probably stuck in a terminal and wonder how to shutdown or restart the system from the command line.
The good thing is that you can easily shutdown or restart Ubuntu from the terminal. And these shutdown commands are not Ubuntu specific, you can use the same command on any Linux distribution.
Restart or Shutdown Ubuntu Linux in Terminal
There are multiple commands you can use to shutdown Linux from the terminal. I would recommend the shutdown command. Itâs easy to remember and easy to use.
Letâs see how can you use this shutdown command for shutting down or restarting your system.
Shutdown Ubuntu Linux immediately
If you use shutdown command without any arguments, it will shutdown your system in one minute. You can change the behavior and shutdown Ubuntu immediately using:
Schedule a shutdown in Ubuntu Linux
You can schedule a shutdown in various ways.
For example, to schedule a shutdown at 03:30 PM, you can use the command in following fashion:
You donât always have to specify the absolute time. You can provide a relative time as well.
For example, to schedule a shutdown 20 minutes from now, you can use shutdown command like this:
Restart Ubuntu Linux immediately
Restarting Ubuntu can also be done with the wonderful shutdown command in Linux. You just have to use the -r option to specify that itâs a reboot request.
By default, if you just use shutdown -r, it will reboot your system after one minute. You can immediately restart Ubuntu like this:
Schedule a restart in Ubuntu Linux
You can also schedule a restart in the same way you scheduled a shutdown.
To schedule a restart at 3:30 PM, you can use:
To schedule a restart 20 minutes from now, you can use:
Cancel a schedule shutdown or reboot
If you have scheduled a shutdown or a restart and later you realized that you donât need it, you can cancel it easily. You just have to use the -c option with shutdown command:
I hope these quick tips helps you to shutdown and restart Ubuntu and other Linux distributions from the command line. Any questions or suggestions are always welcomed.
To shut down or power off a computer is to remove power from a computer's main components in a controlled way. After a computer is shut down, main components such as CPUs, RAM modules and hard disk drives are powered down, although some internal components, such as an internal clock, may retain power.
- 1Implementations
Implementations[edit]
The shutdown feature and command is available in MicrosoftWindows,[1]ReactOS,[2]HPMPE/iX,[3] and in a number of Unix and Unix-like operating systems such as ApplemacOS.
Microsoft Windows and ReactOS[edit]
Windows XP shutdown dialog box
Shutdown options have been moved from a separate dialog box to the start menu, in Windows Vista and later versions of Microsoft Windows. The above is from Windows 7 (this has now moved to the same window in Windows 10).
The shutdown command
In Microsoft Windows and ReactOS, a PC or server is shut down by selecting the Shutdown item from the Start menu on the desktop. Options include shutting down the system and powering off, automatically restarting the system after shutting down, or putting the system into stand-by mode.
There is also a
shutdown
command that can be executed within a command shell window. shutdown.exe
is the command-line shutdown application(located in %windir%System32shutdown.exe)[4] that can shut down the user's computer or another computer on the user's network. Different parameters allow different functions. More than one parameter can be used at a time for this command.[5]Parameter | Function |
---|---|
-l | Logs off a user. This is the default even without using any parameters. |
-a | Stops shutdown.exe. It is used during a time-out period. |
-f | Kills all running applications. |
-s | Turns off the computer. |
-r | Shuts down and reboots a computer. |
-m[ Computer Name] |
When shutting down a network computer, allows you to choose
which computer to turn off.
|
-t xx |
Timer before shut down occurs.
By default it is set to 30 seconds.
|
-c 'message' |
Allows a message to be shown in the System Shutdown window.
It can not be more than 127 characters.
|
Just like other operating systems, Windows has the option to prohibit selected users from shutting down a computer. On a home PC, every user may have the shutdown option, but in computers on large networks (such as Active Directory), an administrator can revoke the access rights of selected users to shut down a Windows computer. Nowadays there are many software utilities which can automate the task of shutting down a Windows computer, enabling automatic computer control. The Windows Shutdown website lists various software utilities to automate the task of shutting down.
In Windows, a program can shut down the system by calling the
ExitWindowsEx
or NtShutdownSystem
function.[6]Apple macOS[edit]
macOS power management dialog box
In ApplemacOS the computer can be shut down by choosing 'Shut Downâ¦' from the Apple Menu or by pressing the power key to bring up the power management dialog box and selecting button 'Shut down'. An administrator may also use the Unix
shutdown
command as well.[7] It can also be shut down by pressing [Alt]+[Command]+[Eject optical disc on optical drive] but this will not prompt the user anything at all.
Unix and Linux[edit]
In Unix and Linux, the
shutdown
command can be used to turn off or reboot a computer. Only the superuser can shut the system down.
One commonly issued form of this command is
shutdown -h now
, which will shut down a system immediately. Another one is shutdown -r now
to reboot. Another form allows the user to specify an exact time or a delay before shutdown: shutdown -h 20:00
will turn the computer off at 8:00 PM, and shutdown -r -t 60
will automatically reboot the machine within 60 seconds (one minute) of issuing the command.[8]See also[edit]
References[edit]
- ^Shutdown | Microsoft Docs
- ^https://github.com/reactos/reactos/blob/master/base/applications/shutdown/shutdown.c
- ^MPE/iX Commands Reference Manual â HP 3000 MPE/iX Computer Systems â Edition 11
- ^'Shut down Windows 10 with just one click (or two)'. CNET. Retrieved 24 April 2017.
- ^'Shutdown'. technet.microsoft.com. Retrieved 24 April 2017.
- ^'NtShutdownSystem'. 25 February 2001. Archived from the original on 2 September 2014. Retrieved 11 April 2015.
- ^
shutdown(8)
â Darwin and macOS System Manager's Manual - ^
shutdown(8)
â Linux Administration and Privileged Commands Manual
Further reading[edit]
- Spolsky, Joel (21 November 2006). 'Choices = Headaches'. Joel on Software. Retrieved 25 August 2010.
- Stanek, William R. (2008). Windows Command-Line Administrator's Pocket Consultant, 2nd Edition. Microsoft Press. ISBN978-0735622623.
- John Paul Mueller (2010). Windows Command Line Administration Instant Reference. Sybex. ISBN978-0470650462.
- Barrett, Daniel J. (2012). Macintosh Terminal Pocket Guide: Take Command of Your Mac. O'Reilly. ISBN978-1449328986.
External links[edit]
Wikibooks has a book on the topic of: Guide to Windows Commands |
- shutdown.cc â an article about various ways of automated and manual shutting down of Microsoft Windows
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Shutdown_(computing)&oldid=918222134'