How to use shutdown command under Ubuntu Linux

by Vivek Gite · 12 comments

Q. I've just installed Ubuntu Linux on my computer. I'd like to know - how to shutdown Ubuntu box over ssh session?

A. If you are not using GUI, you can run halt or shutdown command to powerdown box.

shutdown command

shutdown arranges for the system to be brought down in a safe way. All logged-in users are notified that the system is going down and, within the last five minutes of TIME, new logins are prevented. The shutdown utility provides an automated shutdown procedure for supersers to nicely notify users when the system is shutting down, saving them from system administrators, hackers, and gurus, who would otherwise not bother with such niceties.

How do I use shutdown command?

The shutdown command can be used to turn off or reboot a computer. Type the command as follows to shutdown server / computer immediately:
$ sudo shutdown -h now
OR
$ sudo shutdown -h 0

How do I shutdown compute at specific time?

To shutdown computer at 6:45pm, enter:
$ sudo shutdown -h 18:45 "Server is going down for maintenance"
At 6:30pm message will go out to all user and 6:45 system will shutdown.

Please note that you can also use halt or poweroff or reboot command for stopping and restarting the system:
$ sudo halt
OR
$ sudo poweroff

How do I reboot computer?

Simply use reboot command:
$ sudo reboot
OR
$ sudo shutdown -r 0

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 12 comments… read them below or add one }

1 ashutosh 01.30.09 at 1:42 pm

Hi, the give commads is working properly.

2 andrei 03.25.09 at 7:29 pm

yes…is working properly, BUT…in my case i saw something weird…i’ve used the command $ sudo shutdown -h XX:YY only for test…the actually countdown time was…1minute…after that the PC has automaticly shutdown… OK…but when i’ve started up the PC…the respons was: “biiiiiiiiiiiiiiiiiiiiiiiiiiiip biiiiip biiiip” and nothing else…it’s a normal reaction? or it’s something wrong with my PC?…eventually i solved the problem…i’ve restarted the power supply and then…voila :D

3 markus 05.06.09 at 4:25 pm

Hi, I tried after reading this “shutdown” without “sudo”, to check out the command. Then I got the error “-bash: shutdown: command not found”. That confused me, because normaly you can check out the command, but not execute it without “root-authority”
So don’t forget to add “sudo” =)

4 jadeelite 07.15.09 at 6:54 pm

sudo init 0 will be working fine thanks

5 Lucas Renan 07.17.09 at 10:32 pm

thanx for your help =]

6 Ruel Manaog 07.30.09 at 7:52 am

Thanks for this site.

7 ahmed elmaghrabi 08.12.09 at 12:36 pm

thx
and to cancel the shutdown use
sudo shutdown -c

8 Pierre Paquette 09.19.09 at 12:18 am

Is there any way to make the computer shutdown at a later DATE rather than just a later time? I’m asking because my electricity company says they’ll proceed to work in my area and the “juice” will be cut this coming Monday and this coming Saturday…

9 mafeth 10.22.09 at 10:16 am

is there a way to shutdown other computers using my computer in terminal?help!!!!!

10 cwdownloder 11.11.09 at 5:59 am

sombody helpme
how to remotly shutdown ubuntu computer

11 mathyie 01.15.10 at 6:26 pm

how change theubuntu command to simply button in java

12 xay 01.18.10 at 4:46 am

i want to sare folder in ubuntu 9.10 server now i can connect to ubuntu but i can not share file and folfer
help me please

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All