1

Whenever I open a terminal, I always end up with this same error.

-bash: export: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/hadoop/bin': not a valid identifier

And when I run command lines, I get errors like this:

-bash: sudo: No such file or directory

I can't even edit ~/.bashrc through gedit ~/.bashrc which I think could be the problem. echo $PATH gives me an empty line.

All this stuff happens under my personal account. There's a dedicated hadoop user account, which I created specifically for running hadoop and that works fine without a glitch.

In the process of hadoop setup, which involves editing environment variables, I edited ~/.bashrc as instructed by some tutorials.

What could be the problem, and how might I fix it?

Zanna
  • 70,465
  • looks like you have a different tick at the start than at the end. can you sudo gedit ~/.bashrc? – TmTron Jun 13 '16 at 08:31
  • Ye just change your ` to a normal ' and it should work fine. – Ziazis Jun 13 '16 at 08:31
  • 1
    Btw. since your $PATH isn't working you have to tell the shell exactly where which command is. That means you would need to write something like /usr/bin/sudo /bin/vi /home/user/.bashrc or .profile and correct the issues – Ziazis Jun 13 '16 at 08:36
  • Did you try to edit your ~/.bashrc and ~/.profile by another user with enough privileges? – gwarah Jun 13 '16 at 08:32
  • well, gedit ~/.bashrc solved my problem :) thank you so much – Nishant Kumar Jan 29 '22 at 09:52

1 Answers1

3

Probably your .bashrc or .profile is messedup.

Your gedit will not start if it is not in path and since your path is empty it is not in the path.

You should first establish a good enough path.

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

And then you should be able to start gedit. Alternativelly you could just run gedit with its whole path. Like:

/usr/bin/gedit
  • Thank you very much indeed. At least I can start to debug by running command lines. – James Wong Jun 13 '16 at 10:50
  • @JamesWong the error message suggests it's running export $PATH instead of export PATH, so look for that in particular. – geirha Jun 15 '16 at 11:00