LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-28-2003, 01:47 AM   #1
christer
Member
 
Registered: Sep 2003
Location: Utah
Distribution: Red Hat 9
Posts: 131

Rep: Reputation: 15
paths 'command not found'


Ok I must have messed something up but I'm getting a lot of 'command not found' errors going on. I think, somehow, a file got messed up which lists common paths (or whatever the term is)

Can someone tell me the file that should be edited &/or the basic lines that should be in it?

Example:

I can't run 'ifconfig', 'telinit', 'useradd', etc. They all give me 'command not found', but I'm sure I have those commands.
 
Old 09-28-2003, 04:18 AM   #2
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Re: paths 'command not found'

Quote:
Originally posted by christer
Ok I must have messed something up but I'm getting a lot of 'command not found' errors going on. I think, somehow, a file got messed up which lists common paths (or whatever the term is)

Can someone tell me the file that should be edited &/or the basic lines that should be in it?

Example:

I can't run 'ifconfig', 'telinit', 'useradd', etc. They all give me 'command not found', but I'm sure I have those commands.
Are you logged in as root ? What OS are you using ?
 
Old 09-28-2003, 08:41 AM   #3
chii-chan
Member
 
Registered: Sep 2003
Location: chikyuu (E103N6)
Distribution: Redhat 8.0 (2.4.25-custom), Fedora Core 1 (2.4.30-custom)
Posts: 357

Rep: Reputation: 30
I happened to have the very same problem when I started using linux. Actually the default path for root and user seem to be different. Try 'echo $PATH' when you login as root and when you login as normal user, and compare the two. You can't seem to use it even though you su to root user, you must login as root in the first place. So try 'export PATH=blablabla:/usr/local/sbin:/usr/sbin:/sbin'. The blablabla part is your normal path when you echo $PATH. The point here is to add those sbin things. You can also add the path to .bashrc file in your home directory. Other way, if you are too lazy like I am to bother about export or .bashrc I just /sbin/useradd; /sbin/telinit
 
Old 09-28-2003, 11:00 AM   #4
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Well with Red Hat 9 there's another root user PATH - to get the extended one which includes /sbin and /usr/sbin use

su -
root password

(ie su with a dash after it)
 
Old 09-28-2003, 12:53 PM   #5
christer
Member
 
Registered: Sep 2003
Location: Utah
Distribution: Red Hat 9
Posts: 131

Original Poster
Rep: Reputation: 15
I get 'command not found' if I'm logged in as root or not. It seems, for some reason, that my /sur/sbin & /sbin directories are not being checked. I'll check that .bashrc file to see if those paths are in there but this has gotten annoying.
 
Old 09-28-2003, 01:02 PM   #6
GT_Onizuka
Member
 
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 30
Quote:
Originally posted by Skyline
su -
root password

(ie su with a dash after it) [/B]
are you SURE you are doing

$ su -

and not

$ su

it makes a difference
 
Old 09-28-2003, 01:10 PM   #7
christer
Member
 
Registered: Sep 2003
Location: Utah
Distribution: Red Hat 9
Posts: 131

Original Poster
Rep: Reputation: 15
Ok I see the difference that I get when typing su -. What does that change? That changes the root path?

Thanks.
 
Old 09-28-2003, 02:27 PM   #8
Skyline
Senior Member
 
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104

Rep: Reputation: 45
Quote:
What does that change? That changes the root path?
For some reason in Red Hat 9 , just typing su root password gives you an ordinary users PATH whereas typing su - "dash" root password gives you a typical Root users PATH including directories such as /sbin - it might be su "dash" that you need - you can check out both versions with echo $PATH - the PATHS are quite different - one typical of an ordinary user and one typical of a proper Root user.
 
  


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
Command not found Moataz Red Hat 10 03-30-2010 04:13 AM
bash: <command name> command not found smash Programming 5 03-13-2006 09:48 AM
Getting erro - Library files for "libkcm_k3bsetup2.la" not found in paths error. rsreeni Linux - Newbie 0 08-22-2004 08:07 PM
cc: command not found BobNz Linux - Software 15 04-08-2004 08:42 PM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 11:15 PM


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