2

I do not know why this happened but when I enter a command from terminal for example gedit ~/.bashrc I get the following error:

Command 'gedit' is available in the following places
 * /bin/gedit
 * /usr/bin/gedit
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
gedit: command not found

This happens for also cat, shutdown command etc. How can I solve it?

Kulfy
  • 17,416
  • 26
  • 64
  • 103
efe373
  • 151
  • 5
  • 13
  • It sounds like the `PATH` variable has been changed. What is the result of `echo $PATH`? – schrodingerscatcuriosity Feb 26 '21 at 08:48
  • Did you edit `.bashrc` at some point changing the variable `PATH`? – schrodingerscatcuriosity Feb 26 '21 at 08:53
  • The result of ```echo $PATH``` is ```/storage/IntelFPGA/q18.1/quartus/bin```. Yes, I have edited ```.bashrc``` and add some ```PATH```. Is this the cause of the problem? How can I add my path variables permanently instead of editing ```.bashrc```? – efe373 Feb 26 '21 at 09:05
  • 2
    Please [edit] your question and show the code from your `.bashrc` that modifies `PATH`. Apparently you replaced the value of `PATH` instead of appending/prepending to it. (Until this is fixed, you can run `/usr/bin/gedit ~/.bashrc`.) – Bodo Feb 26 '21 at 09:15

1 Answers1

1

I have forgotten to add :$PATH at the end of the line in ~/.bashrc. Adding it solved my problem. Before edit, it was like export PATH="/storage/IntelFPGA/q18.1/quartus/bin".

Kulfy
  • 17,416
  • 26
  • 64
  • 103
efe373
  • 151
  • 5
  • 13
  • Exactly, see also https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path – pLumo Feb 26 '21 at 11:43