LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-18-2002, 08:45 PM   #1
Rubicone
Member
 
Registered: Oct 2001
Posts: 36

Rep: Reputation: 15
Emergency Help Needed


For some reason I keep getting the "command not found" error message when trying anyone of a number of commands. The most recent being the shutdown one. It has worked up to now but at a loss as to why this is happening. I have checked the permissions on the shutdown command and they are 755. I am logged in as root.

When I type echo $PATH I get the following output to the screeen:

/usr/local/bin:/bin:/usr/bin:/usr/X11R6/:/home/Rubicone/bin

When I issue the which shutdown command the output is:

/usr/bin/which: no shutdown in (within here is the path as noted above)

When I issue the whence shutdown then the aforementioned command not found error message is displayed.
 
Old 03-18-2002, 08:54 PM   #2
TacKat
Member
 
Registered: Jan 2002
Distribution: LFS
Posts: 90

Rep: Reputation: 15
Somehow your path got messed up. The shutdown command is in /sbin along with other sys config binaries.
 
Old 03-18-2002, 09:12 PM   #3
Rubicone
Member
 
Registered: Oct 2001
Posts: 36

Original Poster
Rep: Reputation: 15
Is there a solution? If so then please post it. TIA.
 
Old 03-18-2002, 09:19 PM   #4
hanzerik
Member
 
Registered: Jan 2002
Location: Cheyenne Wyoming
Distribution: Debian/Raspbian/Mint
Posts: 717

Rep: Reputation: 32
edit your .bash_profile file /root/.bash_profile

Yea somehow your $PATH variable got screwed up. Root should have the /sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin

Correct me if I left some out..

Also is you login as a normal user and do just su and give root password you will get what you got when you echo $PATH

use su -
or su root

then you will get roots $PATH
 
Old 03-18-2002, 09:27 PM   #5
Rubicone
Member
 
Registered: Oct 2001
Posts: 36

Original Poster
Rep: Reputation: 15
When I usually log in I do so initially as root by simply typing root and then my password as well as a regular user by opening a second terminal (Alt+F2). I really do not see how my path got changed the way it did. I did manage to shutdown, or rather reboot by exiting then typing su- with my root password. I still don't understand why I got the "command not found" error messages as I was logged in as root to begin with.

Last edited by Rubicone; 03-18-2002 at 09:29 PM.
 
Old 03-31-2002, 01:56 AM   #6
ryandelany
Member
 
Registered: Dec 2001
Location: Orange County, CA
Distribution: RedHat 7.2, 7.3, 8.0
Posts: 66

Rep: Reputation: 15
It sounds like you switched users from another user to root without using the -. If you do su root without the -, then you do not inheret the root users environment. So when you try to run commands that root normally has access to, they won't work as you saw.

If you are going to switch users to root, always use su -, or su - root. Forgetting the - can cause you a lot of headaches.

Ryan
 
  


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
Emergency !! Hampster Mandriva 4 10-31-2005 02:35 PM
Emergency help k1ll3r_x Linux - General 2 04-17-2005 07:32 PM
Emergency Help Needed Please! Rv5 Red Hat 6 09-13-2004 12:20 PM
Emergency! Help needed... askjeffro General 4 05-31-2004 02:45 PM
Emergency mikeyt_3333 Linux - General 4 08-26-2001 02:04 PM

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

All times are GMT -5. The time now is 05:06 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