LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 12-04-2005, 08:19 PM   #1
DR.V
LQ Newbie
 
Registered: Aug 2005
Location: Sydney
Posts: 19

Rep: Reputation: 0
shutdown command


Hi all, Im new with Linux and currently using Fedora Core 4.

I read in a book about "shutdown" command and tried it.
But it says "command not found" , what does that mean ?
I tried putting " shutdown -h now "

Also is there anyway to shutdown the computer right away ?
So far i have to log out first and then from the login page i press "shutdown"

Thanks
 
Old 12-04-2005, 10:28 PM   #2
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
DR.V,

Are you trying to run the shutdown command logged in as root?

Cheers,
Kristijan
 
Old 12-04-2005, 10:32 PM   #3
prabuayyappan
Member
 
Registered: Sep 2005
Location: Coimbatore
Distribution: Prabuayyappan
Posts: 32

Rep: Reputation: 15
since the path is not set.This says command not found

Try using

/sbin/shutdown
----------------------------
To set the path use

export PATH=/sbin

-----------------------------
now you can use

shutdown

to shutdown ur system

Last edited by prabuayyappan; 12-04-2005 at 10:37 PM.
 
Old 12-04-2005, 11:00 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Maybe. Depends on how the distro sets up shutdown processes. If they allow regular users to shutdown from the command line, usually this is considered a security risk (depending on how you look at it of course).

You may need to become root to do this from the command line, or use sudo to launch it with full PATH:
sudo /sbin/shutdown -h now

But this will also depend on how sudo is setup.

Cool
 
Old 12-05-2005, 01:10 AM   #5
DR.V
LQ Newbie
 
Registered: Aug 2005
Location: Sydney
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Kristijan
DR.V,

Are you trying to run the shutdown command logged in as root?

Cheers,
Kristijan
Hi there, im a newbie with linux. Im not sure what you mean.
What I tried is putting "shutdown" command from the konsole.

Thanks
 
Old 12-05-2005, 01:12 AM   #6
DR.V
LQ Newbie
 
Registered: Aug 2005
Location: Sydney
Posts: 19

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by prabuayyappan
since the path is not set.This says command not found

Try using

/sbin/shutdown
----------------------------
To set the path use

export PATH=/sbin

-----------------------------
now you can use

shutdown

to shutdown ur system
This linux is still fresh. I just installed it into my computer last week.
For this command to work, do I have to first set the path ? Or should it work at first place ?
Maybe there something I did wrong is the past days that caused this error ??

Many thanks
 
Old 12-05-2005, 01:38 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by prabuayyappan
To set the path use

export PATH=/sbin
If he does that, surely that will get rid of all the other locations in his $PATH. I think what you mean is "export PATH=$PATH:/sbin".

Quote:
Originally Posted by DR.V
Hi there, im a newbie with linux. Im not sure what you mean.
What I tried is putting "shutdown" command from the konsole.

Thanks
You usually need root privilages to use shutdown and even if you add /sbin to your $PATH, you still might not be able to use it as a normal user. You need to gain root privilages by either 1. using the su command and entering your root password or 2. using sudo as MasterC said. Which one you can use will depend on your distro, please tell us what it is for us to help you more!

Last edited by Nylex; 12-05-2005 at 01:43 AM.
 
Old 12-05-2005, 02:06 AM   #8
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
Quote:
Originally Posted by DR.V
Hi there, im a newbie with linux. Im not sure what you mean.
What I tried is putting "shutdown" command from the konsole.

Thanks
DR.V,

From the konsole window, type the following;

Code:
su -
It will prompt you for a password, enter the root password which you set when you installed the system.

This should take you to a root prompt (#), from there you should be able to shutdown -h now

Regards,
Kristijan
 
Old 12-05-2005, 03:26 AM   #9
DR.V
LQ Newbie
 
Registered: Aug 2005
Location: Sydney
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks Kristijan, it works. Can you please explain why I need to enter "su -" first ?
Is this command should be entered using the "root" ? And to use the "root" we firstly have to enter the password ?

Many thanks
 
Old 12-05-2005, 05:30 AM   #10
arunvk
Member
 
Registered: Nov 2005
Location: India
Distribution: Fedora 29
Posts: 197

Rep: Reputation: 30
to shutdown immediately u have 3 commands
shutdown, poweroff, halt

all 3 do the same

halt however, in some computers, does not turn off the comp

also u dont have to be root to run poweroff and halt
 
Old 12-06-2005, 04:40 AM   #11
DR.V
LQ Newbie
 
Registered: Aug 2005
Location: Sydney
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks for all the replies guys. It helps a lot.
 
  


Reply



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
Shutdown command? MikeZila Linux - Newbie 7 07-27-2008 05:09 PM
shutdown command DR.V Red Hat 2 12-10-2005 07:32 PM
shutdown command xviddivxoggmp3 Red Hat 5 05-12-2004 04:48 PM
shutdown command Oakstaff Linux - Newbie 8 11-18-2003 09:47 PM
shutdown command nelly_boy Linux - Software 11 08-03-2003 06:04 AM

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

All times are GMT -5. The time now is 06:27 AM.

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
Open Source Consulting | Domain Registration