≡ Menu

How to use shutdown command under Ubuntu Linux

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
$ 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
$ sudo poweroff

How do I reboot computer?

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

{ 39 comments… add one }

  • ashutosh January 30, 2009, 1:42 pm

    Hi, the give commads is working properly.

    • rajan December 28, 2010, 1:44 am

      my os is ubuntu fdisk -l shut down comand not found please help

      • amit dulta May 13, 2013, 5:11 am

        following command shut down your system : (sudo shutdown -h 0) try this commsnd…….

  • andrei March 25, 2009, 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

    • Romain January 17, 2013, 3:55 pm

      That was a BIOS error, the POST process was giving errors, so this has nothing to do with Ubuntu

  • markus May 6, 2009, 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” =)

  • jadeelite July 15, 2009, 6:54 pm

    sudo init 0 will be working fine thanks

  • Lucas Renan July 17, 2009, 10:32 pm

    thanx for your help =]

  • Ruel Manaog July 30, 2009, 7:52 am

    Thanks for this site.

  • ahmed elmaghrabi August 12, 2009, 12:36 pm

    and to cancel the shutdown use
    sudo shutdown -c

  • Pierre Paquette September 19, 2009, 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…

  • mafeth October 22, 2009, 10:16 am

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

    • andres July 15, 2011, 6:19 pm

      use ssh.

  • cwdownloder November 11, 2009, 5:59 am

    sombody helpme
    how to remotly shutdown ubuntu computer

    • starver May 26, 2010, 11:38 pm

      yes, by using ssh you can gain full terminal control over a remote computer

  • mathyie January 15, 2010, 6:26 pm

    how change theubuntu command to simply button in java

  • xay January 18, 2010, 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

  • Mack June 11, 2010, 9:48 pm

    shutdown -r now gives me:

    Broadcast message from adminuser@domain.com
    (/dev/pts/2) at 16:55 …

    The system is going down for reboot NOW!

    But then nothing happens. Might there be a process stopping the shutdown? How do I go about finding out which one so I can kill it – I can’t find anything of relevance in any of the /var/log files

  • raymon July 31, 2010, 11:14 am

    The command shutdown -P 0 does not eject my cd-tray with the backtrack4 DVD.Does anybody know of other commands?I have also tried commands as poweroff,eject,logout,exit .
    In Backtrack 3 the dvd gets ejected without problems when logging out,so I don’t think there is anything wrong with my cd-rom station.I have also tried to burn the backtrack4 iso-image to other DVD’s of other brands,but the same problem persists;the cd tray will not eject when logging out.
    (Note that Backtrack 4 is ubuntu-based)

  • Irfan Al-Ghozali August 23, 2010, 5:57 am

    Somebody help me! After my PC have been install Ubuntu 9.10.
    But for shutdown on the Ubuntu. I can’t do it. So My CPU can’t shutdown.
    And then there are like messages or other

    Ubuntu 9.10 irfan-desktop tty1
    irfan-desktop login:(407.109171) ata 1.00:exception Emask 0x0 SACT 0x0 SERR 0x0 action 0x0
    (407.109239) ata 1.00:cmd eo/00:00……./ao tag 0
    (407.109241) res s1/04………Emask 0x1 (device error)
    (407.109340) ata 1.00:status:(DKDY)
    (407.109388) ata 1.00:error:(ABRT)
    (407.931963) System halted

    Help me, please! How to do normal shutdown in ubuntu.
    I hope you can answer my question.

  • Irfan Al-Ghozali August 23, 2010, 6:03 am

    And so, I have been use terminal like in here
    Help me

  • Nuc134rB0t November 17, 2010, 4:41 am

    sudo init 6

  • Barbecue Grill Charcoal February 19, 2011, 7:33 pm

    I am looking for this command.

  • WarezX February 20, 2011, 9:37 am

    i need help how to sharing network im using win xp dual sun vitualbox backtrack between 3.5G modem HSDPA, could anyone help me how to

  • Praveen April 4, 2011, 8:51 am

    Ubuntu is cool ;) Very nice collection of Terminal commands :)

  • Richard "Bloonaholic" April 8, 2011, 3:05 am

    Nice, the terminal commands worked flawlessly!

  • shuck July 4, 2011, 7:36 am

    how to to reboot to windows 7 while in ubuntu using Teminal?

    • Romain January 17, 2013, 3:58 pm

      If you installed GRUB boot loader it will ask for an OS at the startup

  • Pein Nagat0 July 31, 2011, 2:34 pm

    how to link the file of windows 7 to linux ubuntu using clint and server?

  • Indra Saputra Ahmadi November 11, 2011, 11:34 pm

    how i can shutdown another computer in my networks?

  • switchoff January 26, 2012, 6:21 pm

    > how i can shutdown another computer in my networks

    linux (I suggest, there is a windows-cli-command called “shutdown”, which works for remote windows systems to shut them down or reboot them too, but I don’t know any details):

    1.) a) install an ssh-server (and client) on your remote linux computer
    1.) b) install an ssh-client (windows: f.i. PuTTY)
    2.) connect to remote linux system (linux: > ssh @
    3.) use ‘sudo reboot’ for reboot or ‘sudo poweroff’ to power off the remote linux system

    another hint:

    ‘halt’ is NOT equal to ‘poweroff’ (tested on ubuntu 11.10)

    If you use ‘sudo halt’ on linux cli, the system will shut down, but not power off, so you have to push to power off button (or power off the virtual machine) manually.
    ‘sudo poweroff’ will additionally power off the computer (or the VM).

  • vlatko175 March 6, 2012, 9:57 pm

    thank’s work

  • James April 27, 2012, 8:01 pm

    How would I issue a reboot command and include a message that to all users that the system will be rebooting in an hour?

  • TaGy October 17, 2012, 9:56 pm

    Thanks Broo

  • leorikz January 9, 2013, 12:47 pm

    thx for help)

  • ranjith January 14, 2014, 7:11 am

    the cmd shutdown -h doesnot worh in linux mint

  • Anand Kumar December 10, 2014, 3:33 pm

    halt is not same as poweroff unless with -p or –poweroff

    so, sudo poweroff is same as sudo halt -p or sudo halt –poweroff

    Please update!

  • the new sysadmin May 6, 2015, 2:52 pm

    Good question. I haven’t seen my solution here so here are my 2 cents. *Disclaimer, the following is an unorthodox method, but if your main goal is to shut down a box to for instance save energy do the following. Take a sledgehammer and beat the server up. This process depends on physical strength, but on average should not take longer than 1 minute. This would however require you to have physical access to the server. Fortunately the sledgehammer can also come in handy here for bypassing or trespassing server storage facilities. As with anything use the right tool for the right situation. But never forget to think out of the box.

  • Taylie Cruz September 8, 2015, 4:10 am

    The IP address of the computer you are using is and currently logged in using SSH. You can also access a shutdown command. Question: If you execute the shutdown command in your computer, which computer unit will turned off (your own computer, the computer that has an IP of, both computers)? And why?

Leave a Comment

   Tagged with: , , , , , , , , , , ,