I'm unable to open bashrc file in ubuntu. I tried using gedit ~/.bashrc and vi commands but its not opening.

When I open a terminal everytime, its displaying the problem like

bash: export: `/opt/grads-2.1.0.oga.1/Contents/Resources/SampleDatasets :/usr/local/ferret/bin:/home/user/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin': not a valid identifier

After running the .profile, I'm getting the issues like

user@revathi:~$ . ~/.profile
bash: lesspipe: No such file or directory
bash: dircolors: No such file or directory
bash: ls: No such file or directory
bash: grep: No such file or directory
bash: export: `/opt/grads-2.1.0.oga.1/Contents/Resources/SampleDatasets :/usr/local/ferret/bin:': not a valid identifier

Could anyone please help me to fix the path?

  • What error do you get using gedit or vi? – stumblebee Dec 27 '17 at 8:12
  • user@revathi:~$ gedit ~./bashrc bash: gedit: No such file or directory is displayed – REVATHI Dec 27 '17 at 8:14
  • user@revathi:~$ gedit ~/.bashrc Command 'gedit' is available in '/usr/bin/gedit' The command could not be located because '/usr/bin' is not included in the PATH environment variable. gedit: command not found – REVATHI Dec 27 '17 at 8:39

You changed your PATH variable and included a space which hinders the system to find crucial programs. Call gedit with the full path with

/usr/bin/gedit ~/.bashrc

and correct the error. I suspect the faulty line looks like this in your case:

PATH="/opt/grads-2.1.0.oga.1/Contents/Resources/SampleDatasets :$PATH"

while it should be


instead. Then save the file, source it with . ~/.bashrc or just open a new terminal and your terminal should be back to normal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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