LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-22-2004, 12:06 PM   #1
jchun
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
-bash: ls: command not found


Hi!
This is the first time to post my question here.

In Fedora core 2, I got following error when I only logged in as "root".
"-bash: ls: command not found"
I think all bash commands are having problems.
However, the other user ids seem fine for the commands.


How can I fix this problem?
Please help me out!!
I really appreciate it.
 
Old 10-22-2004, 12:11 PM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
If you used 'su' to switch to root, make sure you use 'su -'. It is a problem with the PATH variable, if it had nothing to do with su then you need to make sure it is set properly:
echo $PATH (displays the PATH)
set PATH=$PATH:/bin (sets path to what it was before + /bin)
 
Old 10-22-2004, 12:24 PM   #3
jchun
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Original Poster
Rep: Reputation: 0
I really apprciate your answer. However,...

Wow. in this linuxquestion, the response is so fast.
I really apprciate your answer.
However,
When I typed "echo $PATH"
I got "/opt/manage/ant-1.6.2/bin:/opt/manage/maven-1.0/bin"

So, like you mentioned, I tried "set PATH=$PATH:/bin"
Same results I got.
Still bash commands are not working in "root"

I am sorry for the easy question.
But, please help me.
I really appreciate it.

Last edited by jchun; 10-22-2004 at 12:47 PM.
 
Old 11-02-2004, 10:11 AM   #4
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
How are you logging in as root? If it is with su, make sure you use the dash with it (su -). If that doesn't solve it then check the /root/.bashrc and /etc/profile files, and make sure the right directories are in the list added to the PATH. Also, in the meantime typing /bin/ls should work.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: command not found! Adil_uk Linux - General 14 04-09-2012 01:04 AM
bash: pg: command not found Chomper Programming 2 02-05-2005 02:22 AM
-bash: cp: command not found johnlittlepeap Fedora 2 11-15-2004 08:52 AM
bash -command not found- K3V Linux - Newbie 7 09-30-2004 03:57 PM
bash: command not found jc80 Fedora 3 03-14-2004 03:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration