Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Maybe a bash command or something?

share|improve this question
5  
Please add your OS, even though everyone already assumes it's Linux –  Ivo Flipse Sep 24 '09 at 14:23
1  
BTW: is there any reason you need a reset if you can simply use the normal shutdown options? Reset is only required if your computer is stuck or you lack GUI options to perform the action –  Ivo Flipse Sep 24 '09 at 14:27
1  
make sure, if you're on a remote system, u shut down the right machine :) always double check ur on the right machine –  Roy Rico Sep 25 '09 at 21:20
add comment

7 Answers

up vote 8 down vote accepted

Different versions of linux have different commands to shutdown and reboot the computer. Either provide the OS and distribution you're using, or try these commands:

  • shutdown -r now
  • init 6
  • reboot

If you want to only power it down, use:

  • shutdown -h now
  • halt
  • poweroff
  • init 0

Both sets of commands typically need sudo permission to execute.

share|improve this answer
    
It's init 6 for a reboot. –  Dave Webb Sep 24 '09 at 15:50
    
@Dave Thanks. I compiled the whole answer under the assumption user wanted to halt the machine. You're right, it's init 6 for reboot and init 0 for halt. –  nagul Sep 24 '09 at 16:00
    
I typically use reboot and halt -p (halt and power off) –  Roy Rico Sep 25 '09 at 21:19
add comment

Since you are asking about a "bash command or something", I assume that you are on Linux or something. Try this:

sudo shutdown -r now

This will restart the machine.

share|improve this answer
    
On some distros you need SU privileges in order to execute this command. So if this won't work for you try putting sudo at the front of shutdown -r now. –  Mike Sep 24 '09 at 14:25
    
Never personally seen a distro that didn't require superuser for this. I have always needed to use sudo. –  Joshua Nurczyk Sep 24 '09 at 14:45
    
Good point. Edited the answer accordingly. –  innaM Sep 24 '09 at 14:49
1  
And by the by: when I was a newbish Linux user, there was no other option. –  innaM Sep 24 '09 at 15:27
1  
Some Unix systems do not require root privileges to shutdown a machine locally. The rationale being that a user with physical access to the big red button will use it if other methods are not available. I think this is wise. I have an Ubuntu VM from a default install. It requires root to use shutdown, but allows me to turn the machine via Gnome without root. Same thing with OpenSolaris. This seems odd. –  Richard Hoskins Sep 24 '09 at 16:04
show 3 more comments

If you have Magic SysRq enabled in your kernel, you can use alt+printscreen+(char) even if your system is relatively broken. (for example, if X is hosed)

Don't use this approach unless you can't do a normal shutdown -- shutdown -r now or similar is far better if you actually have a usable command line.

share|improve this answer
add comment

Well, assuming you run the bash on some Unix environment, you should have shutdown command, which has "-r" option for rebooting.

Manuals for this can be found by issuing "man shutdown" command, or by checking this page for BSD or this page for Linux versions of the shutdown.

share|improve this answer
add comment

Right click on any blank space of windows desktop -> New -> Shortcut. A “Create Shortcut” window will open.

In the blank, type in: shutdown.exe -r -t 0
Click “Next” button for next step. Type in whatever name you like in the blank. I use “Restart”. Then, click “Finish” button.
You can also set “Shortcut key” in the shutdown shortcut’s propertise to shutdown computer using keyboard shortcut.

share|improve this answer
add comment

For SysV style: shutdown -g0 -y -i6

For BSD style: shutdown -r now

share|improve this answer
add comment

Two sequential CTRL+ALT+DEL commands will reset Windows* machines.

* I haven't used this since XP...

share|improve this answer
    
not anymore, not for a while –  emgee Sep 24 '09 at 16:22
1  
did even XP allow this? I thought it went out when NT came along. –  Phoshi Sep 24 '09 at 16:24
    
I have occasion to use it on XP machines around here. Still works. –  Brian Knoblauch Sep 24 '09 at 16:51
    
This doesn't work on XP. –  William Hilsum Sep 24 '09 at 18:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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