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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-11-2004, 05:22 PM
|
#1
|
Member
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Rep:
|
bash -command not found-
Hi guys
I do not know why this happens, and if anyone can help I would be thankful
The story is that sometimes when I use the bash console, I enter common and know commands and it just says "command not found" For example:
[root@localhost aliserver]# ifconfig
bash: ifconfig: command not found
Although Iam logged in as root, and although ifconfig is a common command.
Please help me guys . Iam using RH 9.0
|
|
|
09-11-2004, 05:27 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Let me guess .. you logged in as a normal user
and then used su?
Try again, this time with "su -" ... the
- is important, otherwise you inherit the normal
users path which shouldn't have sbin in it.
Cheers,
Tink
|
|
|
09-11-2004, 05:45 PM
|
#3
|
Member
Registered: Jul 2004
Location: USA
Distribution: Slackware, FreeBSD, LFS
Posts: 72
Rep:
|
It sounds like the command you are trying is not in your current
PATH. When you type a command on the prompt, bash checks
for it's file in all folders inside your PATH environmental variable.
To check your PATH
# echo $PATH
To find the location of a command
# which [command name]
Depending on your configuration, if you open a shell as a user,
then su root, your PATH will still be that of the user you su'd from.
Most users don't have access to /sbin directory's, as they contain
a lot of commands for system admin type activities. So what you
will need to do as root is add a directory to your PATH variable.
# PATH=$PATH:/sbin
This ads /sbin to the existing PATH. If you are using slackware,
you will probably want to add /usr/sbin.
# PATH=$PATH:/usr/sbin
Now bash will search those directories for the command you are
trying to use. To see the changes
# echo $PATH
Once you have figured out what directories you want to add to
you PATH, you can add these to your ~/.bashrc file to have them
executed when you enter the shell. This should also work when
you su from another user.
Hope this helps
|
|
|
12-30-2006, 12:41 PM
|
#4
|
Member
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Original Poster
Rep:
|
Both solutions work perfectly
Note: Iam checkin all my posts to check if there are any issues I have resolved but not posted to that other users can benefit "That is why Iam that late"
|
|
|
All times are GMT -5. The time now is 12:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|