Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Terminal commands for rebooting

  1. #1
    Join Date
    Jan 2011
    Location
    Langley, BC, Canada
    Beans
    260
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Terminal commands for rebooting

    Hello everyone. A little while ago, my laptop had a crash, and I tried rebooting. First it asked me which distro to boot, then in what mode. I clicked normal, then it asked for a login. I did so, then it just let me put in a terminal command. Could someone please tell me which commands I should use to shut it down, reboot, and anything else I should do? Should I just boot normal or should I do something different? Thanks in advance.
    Ubuntu: the next best thing to Mac OS X.

  2. #2
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,803

    Re: Terminal commands for rebooting

    Quote Originally Posted by TimmyK. View Post
    Hello everyone. A little while ago, my laptop had a crash, and I tried rebooting. First it asked me which distro to boot, then in what mode. I clicked normal, then it asked for a login. I did so, then it just let me put in a terminal command. Could someone please tell me which commands I should use to shut it down, reboot, and anything else I should do? Should I just boot normal or should I do something different? Thanks in advance.
    Code:
    sudo shutdown
    sudo shutdown -r now
    sudo reboot
    sudo shutdown -h now
    sudo poweroff
    You can use the man pages to look up options for these commands and find which one you want or need

    example:
    Code:
    man shutdown
    Last edited by haqking; December 23rd, 2012 at 01:48 AM.
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  3. #3
    Join Date
    Jan 2011
    Location
    Langley, BC, Canada
    Beans
    260
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Terminal commands for rebooting

    Thanks! And how would I boot normally? Just "sudo boot"?
    Ubuntu: the next best thing to Mac OS X.

  4. #4
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,803

    Re: Terminal commands for rebooting

    Quote Originally Posted by TimmyK. View Post
    Thanks! And how would I boot normally? Just "sudo boot"?
    if you can type a command then you have already booted

    I dont get your question ?
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  5. #5
    Join Date
    Apr 2012
    Location
    Quebec, Canada
    Beans
    261
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Terminal commands for rebooting

    Quote Originally Posted by haqking View Post
    Code:
    sudo shutdown
    sudo shutdown -r now
    sudo reboot
    sudo shutdown -h now
    sudo poweroff
    You can use the man pages to look up options for these commands and find which one you want or need
    What's the difference between sudo shutdown -r now and sudo reboot ? Same for sudo shutdown & sudo shutdown -h now ?

    Thanks for the precision!

  6. #6
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,803

    Re: Terminal commands for rebooting

    Quote Originally Posted by GameX2 View Post
    What's the difference between sudo shutdown -r now and sudo reboot ? Same for sudo shutdown & sudo shutdown -h now ?

    Thanks for the precision!
    poweroff can usually be done without sudo depending on the system.

    Shutdown -r and reboot are the same thing (symlinks)

    use the man pages to find extra options

    Peace
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  7. #7
    Join Date
    Aug 2012
    Location
    Queensland, Australia
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Terminal commands for rebooting

    Quote Originally Posted by TimmyK. View Post
    Thanks! And how would I boot normally? Just "sudo boot"?
    I think you mean "reboot normally" and "sudo reboot" would do it, it was one command in haqking's previous post, so yes.
    Last edited by coldcritter64; December 23rd, 2012 at 02:02 AM. Reason: sorry about the spelling error haqking :)

  8. #8
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Terminal commands for rebooting

    I think the critical part is how to avoid hard reset (the power button or the electric plug or remove the battery depending on what computer it is). Because hard reset can shut off the system before important things have been written to the hard disk drive.

    When your computer won't respond to normal key presses or mouse actions, try to press a key sequence while pressing

    alt + SysRq all the time

    r e i s u b (slowly, maybe one key each second)

    This shuts down the run levels and performs necessary writes to disk if possible at all, and it works most of the time.

    After such a reboot, the computer is likely to boot normally.

    If not it might be possible to repair the root file system. Boot from another drive (from a repair file system or from the Ubuntu install drive), avoid mounting anything on the hard drive and run
    Code:
    sudo e2fsck -f /dev/sdxy
    where x is the drive letter, often a, and y is the partition number on that drive, often 1, 5 or 6, e.g. /dev/sda6

  9. #9
    Join Date
    Jan 2011
    Location
    Langley, BC, Canada
    Beans
    260
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Terminal commands for rebooting

    Sorry, I'm getting a little confused. Do I just type in the command you gave me and reboot? Am I in a terminal mode or something?
    Ubuntu: the next best thing to Mac OS X.

  10. #10
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Terminal commands for rebooting

    Quote Originally Posted by TimmyK. View Post
    Sorry, I'm getting a little confused. Do I just type in the command you gave me and reboot? Am I in a terminal mode or something?
    alt+SysRq reisub works in linux independent of graphical or text screen mode. It is a hot-key sequence.

    But if your system is up and running normally, you can use
    Code:
    sudo reboot
    to reboot and
    Code:
    sudo poweroff
    to poweroff (shutdown, including power).

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •