How to Shutdown your Linux Machine from Terminal

M

Microsuck

Guest
Go into .bashrc and add this:

Code:
quit ()
        {
            poweroff -d
         }

Then in Terminal, you can type:

Code:
sudo quit
 


OP
T

tux.think

Guest
you can use the commands listed here
tuxthink.blogspot.com/2012/01/different-commands-to-shutdown-or.html
 
OP
O

oldslackware

Guest
I don't understand why you complicate your life with script.
su
halt
or
su
shutdown -h now
 
OP
L

lucasbytegenius

Guest
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.
 
OP
R

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?")
 
OP
D

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!!!!!!!!!!!!!!!!!!!!!!!!
 
OP
B

Bill

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!!!!!!!!!!!!!!!!!!!!!!!!

This is to try to keep out spambots. They love to post links.
 
OP
D

designer

Guest
Thank you

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

Bill

Guest
I don't understand why you complicate your life with script.
su
halt
or
su
shutdown -h now

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.
 
OP
N

nubbix

Guest
If ever needed, i always do sudo shutdown now, or sudo restart now
 
OP
M

mudrock

Guest
If ever needed, i always do sudo shutdown now, or sudo restart now

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.
 
OP
L

lucasbytegenius

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.

I also leave my machine running all the time. It's rare that I do shut it down or restart it, except for updates.
 
OP
F

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
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Members online


Top