LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Getting bash to login as root and recognize commands like "vi" and "locate" (http://www.linuxquestions.org/questions/linux-software-2/getting-bash-to-login-as-root-and-recognize-commands-like-vi-and-locate-723678/)

ajaygoeslinux 05-04-2009 05:13 PM

Getting bash to login as root and recognize commands like "vi" and "locate"
 
The subject line pretty much says it all. I reinstalled my CentOS 5.2 OS today, updated yum and bash and started trying to locate and edit files. Each time I run "locate [name]" or "vi [file]", I get "command not found".

Also, no matter what I do, log off, reboot, whatever, I get only "-bash-3.2#" on which to execute commands rather than "[root@hostname~]" and I can't seem to set the hostname because bash won't recognize the commands or allow me to edit files! I did FIND that the server recognizes the hostname but, even after rebooting and logging back onto my SSH, I still only get "-bash-3.2#", I couldn't fix the problem.

Please help so I can move on with my life. Thanks.

April

Tinkster 05-04-2009 06:25 PM

Hi, and welcome to LQ!

There could be several underlying issues.
  • Some apps simply didn't get installed ...
  • for some reason bash isn't evaluating some of the normal startup-files
  • permissions/ownerships on relevant files are screwy

What do you get when you do
Code:

echo $PATH
?



Cheers,
Tink

ajaygoeslinux 05-04-2009 10:21 PM

Quote:

Originally Posted by Tinkster (Post 3530122)
Hi, and welcome to LQ!

There could be several underlying issues.
  • Some apps simply didn't get installed ...
  • for some reason bash isn't evaluating some of the normal startup-files
  • permissions/ownerships on relevant files are screwy

What do you get when you do
Code:

echo $PATH
?



Cheers,
Tink

Thank you for your willingness to help. I'd like to get this resolved.

The output from echo $PATH: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Let me know what you think. I can "vi" anything so I can't read any files.

April

Tinkster 05-04-2009 11:41 PM

What does
Code:

rpm -qa | grep vi
show you?

And
Code:

rpm -ql bash
?


Cheers,
Tink

Libu 05-04-2009 11:51 PM

Are you able to find the executables under /usr/bin ?
Quote:

ls /usr/bin/ | grep -e vim -e locate


All times are GMT -5. The time now is 04:44 PM.