0

On bash all these commands generates the same message which is "command not found".

Here is the recent session from my terminal:

bash --version > -bash: bash: command not found
ls /usr/local/bin/ > -bash: ls: command not found

Any help would be greatly appreciated.

5
  • 1
    Did you edit your ~/.bashrc recently? What do you see with echo "$PATH"? To get back on track while you're figuring out what happened, do PATH=$(getconf PATH) Commented Nov 25, 2021 at 17:17
  • This is an XY Problem. You really need to fix your PATH environment variable. Reinstalling bash won't fix a broken PATH.
    – Spiff
    Commented Nov 25, 2021 at 23:44
  • @glennjackman. Thanks for your valuable inputs. I have managed to fix my .bash_profile now and every this is back to normal!!
    – Singam
    Commented Dec 2, 2021 at 16:45
  • @Spiff, yes the PATH was broken indeed which I have now fixed.
    – Singam
    Commented Dec 2, 2021 at 16:46
  • @Singam Excellent! The thing to do now for this Question is to post your own Answer on how you fixed it, and then accept your own Answer by clicking the checkmark outline next to it. This will mark your issue as resolved, so others with the same question will find your solution in the future.
    – Spiff
    Commented Dec 2, 2021 at 17:43

1 Answer 1

0

I checked my .bash_profile on Mac and there was a syntax error that was corrupting the whole thing. From

export PATH="/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin:$PATH'

To

export PATH="/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin:$PATH"

The PATH value now begins with a double quote and ends with a double quote as well, whereas earlier, it ended with the single quote.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .