LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shutdown command (https://www.linuxquestions.org/questions/linux-newbie-8/shutdown-command-389286/)

DR.V 12-04-2005 08:19 PM

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

Kristijan 12-04-2005 10:28 PM

DR.V,

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

Cheers,
Kristijan

prabuayyappan 12-04-2005 10:32 PM

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

MasterC 12-04-2005 11:00 PM

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

DR.V 12-05-2005 01:10 AM

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

DR.V 12-05-2005 01:12 AM

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

Nylex 12-05-2005 01:38 AM

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!

Kristijan 12-05-2005 02:06 AM

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

DR.V 12-05-2005 03:26 AM

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

arunvk 12-05-2005 05:30 AM

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

DR.V 12-06-2005 04:40 AM

Thanks for all the replies guys. It helps a lot.


All times are GMT -5. The time now is 07:15 AM.