LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2009, 04:29 AM   #1
Scorpionkingin
LQ Newbie
 
Registered: May 2009
Posts: 5

Rep: Reputation: 0
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................!
 
Old 05-11-2009, 04:33 AM   #2
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

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

Ajit
 
Old 05-11-2009, 04:34 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
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.

Last edited by linuxlover.chaitanya; 05-11-2009 at 04:36 AM.
 
Old 05-11-2009, 05:31 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
i think "poweroff" also will help you to shutdown the server
 
Old 05-11-2009, 05:51 AM   #5
Libu
Member
 
Registered: Oct 2003
Location: Chennai
Distribution: Slackware 12.1
Posts: 165

Rep: Reputation: 36
Quote:
Originally Posted by linuxlover.chaitanya View Post
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
 
Old 05-11-2009, 06:24 AM   #6
archShade
Member
 
Registered: Mar 2006
Location: Delft NL
Distribution: Debian; Slackware; windows 7
Posts: 218

Rep: Reputation: 53
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
 
Old 05-11-2009, 06:31 AM   #7
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 63
Or “halt”.
 
Old 05-11-2009, 07:37 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,445
Blog Entries: 4

Rep: Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897
"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.
 
Old 05-11-2009, 05:24 PM   #9
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Debian + Ubuntu
Posts: 4,358

Rep: Reputation: 57
Hell, on many modern distros you could even just press the power button briefly and it'll do the job for you!
 
Old 05-11-2009, 11:12 PM   #10
Scorpionkingin
LQ Newbie
 
Registered: May 2009
Posts: 5

Original Poster
Rep: Reputation: 0
@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..........!
 
Old 05-12-2009, 01:15 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,395

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
We've given you a bunch of ways; what seems to be the problem?
 
Old 05-12-2009, 03:57 AM   #12
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by Scorpionkingin View Post
@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.
 
Old 05-12-2009, 07:38 AM   #13
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 6
Posts: 354
Blog Entries: 4

Rep: Reputation: 63
Just don't shut it down. Then see how long it lasts for
 
Old 05-12-2009, 07:52 AM   #14
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,665

Rep: Reputation: 485Reputation: 485Reputation: 485Reputation: 485Reputation: 485
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.
 
Old 05-13-2009, 12:08 AM   #15
Scorpionkingin
LQ Newbie
 
Registered: May 2009
Posts: 5

Original Poster
Rep: Reputation: 0
@ All above,

Thanks.........


~Scorpion King
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use VLC to stream AVI files from one Linux machine to another Linux machine bgoodr Linux - Software 4 05-24-2009 11:18 AM
Restarting Windows machine stops Linux machine mounting/connecting jamespetts Linux - Networking 3 05-29-2008 03:12 AM
machine cannot shut down after being loaded with mandrakelinux10.1 paranjyoti Linux - Newbie 2 10-18-2006 07:03 AM
how to watch linux client machine desktop(activities) from windows machine deepak rawat Linux - Networking 7 07-03-2006 04:59 PM
Shut down machine after log of uuccu Linux - General 1 11-24-2004 01:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration