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?

  • looks like you have a different tick at the start than at the end. can you sudo gedit ~/.bashrc?
    – TmTron
    Jun 13, 2016 at 8:31
  • Ye just change your ` to a normal ' and it should work fine.
    – Ziazis
    Jun 13, 2016 at 8:31
  • Did you try to edit your ~/.bashrc and ~/.profile by another user with enough privileges?
    – gwarah
    Jun 13, 2016 at 8:32
  • 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, 2016 at 8:36
  • well, gedit ~/.bashrc solved my problem :) thank you so much Jan 29, 2022 at 9:52

1 Answer 1


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:

  • Thank you very much indeed. At least I can start to debug by running command lines.
    – James Wong
    Jun 13, 2016 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, 2016 at 11:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.