Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again. Thanks!

How to Shutdown your Linux Machine from Terminal

Discussion in 'General Linux' started by Microsuck, May 28, 2012.

  1. Microsuck

    Microsuck Guest

    Go into .bashrc and add this:

    quit ()
                poweroff -d
    Then in Terminal, you can type:

    sudo quit
  2. tux.think

    tux.think Guest

    you can use the commands listed here
  3. oldslackware

    oldslackware Guest

    I don't understand why you complicate your life with script.
    shutdown -h now
  4. emma11

    emma11 Guest

    very complicated this script and what is this dude.
  5. I usually use sudo shutdown -h now if I can't shut the machine down with the GUI. I don't see why we need a quick command for this.
  6. Rob

    Rob Guest

    It's best to memorize commands and use programs that you can use on all linux machines.. that way if you're on someone else's machine - or a machine you've never been on.. you can get whatever it is you want done. Also, learn everything from command line.

    shutdown: shutdown -r now

    editor: vi / vim ;)

    (i'll never install emacs on the linux boxes at work.. at least once/week i hear "aww.. isn't emacs on here?")
  7. designer

    designer Guest

    An error has occurred D! You must have 5 posts in order to post links. Your current post count is 4.
    WHY WHY WHY!!!!!!!!!!!!!!!!!!!!!!!!
  8. Bill

    Bill Guest

    This is to try to keep out spambots. They love to post links.
  9. pane-free

    pane-free Guest

    why not
    init 0
  10. designer

    designer Guest

    Thank you

    But I really want to know how make a spam, that's seem very interesting, ah?!
  11. Bill

    Bill Guest

    Why make a script to do this? There are a couple of reasons that come to mind. First, you may want a script to launch at a certain time. You may not be there to type in the command.

    Second, you may make a launcher for the script in case the machine is being stubborn. When I upgraded from Ubuntu 10.10 to 12.04, selecting shutdown only logs me out. Even at the log in screen, I am no longer able to shutdown or restart, it just leaves me at the log in prompt. I could write a short script with a launcher to bypass this problem until I fix it. If I hadn't already made up my mind to switch to Fedora, I would have probably chosen that option rather than opening a terminal each time to type in the commands.
  12. Bill

    Bill Guest

    It's a secret recipe. I could tell you, but...well, you know what would happen.
  13. Akendo

    Akendo Guest

    Shutdown? I don't shutdown a Linux!
  14. ntaloventi

    ntaloventi Guest

    on arch just type on terminal :
    $ sudo poweroff
  15. nubbix

    nubbix Guest

    If ever needed, i always do sudo shutdown now, or sudo restart now
  16. Um, I'm not sure you'd want to do that, the consequences are usually very bad.
  17. mudrock

    mudrock Guest

    same. Most of the time I will just leave my machine running. I'm not that dedicated to that one so I think everything turns out okay and I haven't had many issues.
  18. I also leave my machine running all the time. It's rare that I do shut it down or restart it, except for updates.
  19. flotwig

    flotwig Guest

    Easier methods:

    • sudo shutdown # shuts down system with a delay
    • sudo shutdown -r # restarts system with a delay
    • sudo shutdown now # shuts it down immediately
    • sudo shutdown -r now # restarts immediately

Share This Page