LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to shut down linux machine (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-shut-down-linux-machine-725147/)

Scorpionkingin 05-11-2009 04:29 AM

How to shut down linux machine
 
Hi guys,
I am new for linux.
Can anyone tell me which is command to shutdown Linux machine?
Waiting 4 reply,

Thanks and Regards,

Scorpionking................!

Ajit Gunge 05-11-2009 04:33 AM

Hi
Shutdown is the command to shutdown a linux machine.Is this what you were looking or something else.

Ajit

linuxlover.chaitanya 05-11-2009 04:34 AM

init 0 (zero in numerics)

shutdown -h now

You will need to be root for this probably if you are not in graphical mode.
But you should have probably got the answer by just googling with correct search. The topics should have been covered in here at LQ as well.

kirukan 05-11-2009 05:31 AM

i think "poweroff" also will help you to shutdown the server

Libu 05-11-2009 05:51 AM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3536824)
init 0 (zero in numerics)

shutdown -h now

You will need to be root for this probably if you are not in graphical mode.
But you should have probably got the answer by just googling with correct search. The topics should have been covered in here at LQ as well.


Instead of changing run level manually, you could do this as well :

Code:

shutdown -t0 -h now

archShade 05-11-2009 06:24 AM

More info is needed. Which distro are you using, Do you have a graphical login?. Do you have root privaleges? If not are you in the sudoers list


if you have a graphical interface there should be a button but without knowing which graphical interface I cant tell where it is. This may ask you for your password if it uses sudo, or root password if not, or maybe no password at all

if your on sudoers list use: sudo poweroff
or: sudo shutdown -h "now"
both of these will prompt for your password.



If your sytem dosen't have sudo or you are not on the list. but you have root password use: su -c "poweroff"
or: su -c "shutdown -h "now""
both of these will ask for the root password.


It is best never to login as root and only switch to root when you have to using su (type exit to leave root), su -c "command" (like su but one shot), sudo (like su -c but allows diffrent users to use different commands, generally considered to be more secure if correctly set up), and finally sudo sh (just like su).

also remember man command. It's invaluable as typing man command will give a manual for a commands. man pages do seem alien at first learning to read them is well worth the time

theYinYeti 05-11-2009 06:31 AM

Or “halt”.

sundialsvcs 05-11-2009 07:37 AM

"shutdown" is the correct incantation. Don't use "halt."

There should be a nice, civilized, "turn off computer" choice in the taskbar of the GUI... just like in Windows.

Shutting down a Linux machine, technically speaking, is done by telling it to switch to a particular runlevel. But "shutdown" (or its GUI equivalent) is the graceful, and intended, way to do that.

Thymox 05-11-2009 05:24 PM

Hell, on many modern distros you could even just press the power button briefly and it'll do the job for you!

Scorpionkingin 05-11-2009 11:12 PM

@All above

I have full access to Linux server.
and I just want to shutdown server from command line. So please give me exact command to shutdown.

Thanks and Regards,

Scorpion king..........!

chrism01 05-12-2009 01:15 AM

We've given you a bunch of ways; what seems to be the problem?

linuxlover.chaitanya 05-12-2009 03:57 AM

Quote:

Originally Posted by Scorpionkingin (Post 3537791)
@All above

I have full access to Linux server.
and I just want to shutdown server from command line. So please give me exact command to shutdown.

Thanks and Regards,

Scorpion king..........!

Dont you think all were valid answers to your question and being such a simple question that you could have solved it yourself by googling these many number of replies are more than enough to get a very valid solution. Use any of the above command that you wish to.

nigelc 05-12-2009 07:38 AM

Just don't shut it down. Then see how long it lasts for:)

malekmustaq 05-12-2009 07:52 AM

Scorpionkingin:

Quote:"I have full access to Linux server.
and I just want to shutdown server from command line. So please give me exact command to shutdown."

Answer:

If you have full access to the server you can do any of the above instructions and it will shutdown.

Or, do you mean you wanted to shutdown down the server remotely? Please ask your question clearly.

Hope this helps.

Scorpionkingin 05-13-2009 12:08 AM

@ All above,

Thanks.........


~Scorpion King


All times are GMT -5. The time now is 02:25 AM.