I ended up screwing up my terminal, while setting up Sbt for the Coursera Scala course. I can't summon gedit (or anything else) anymore. I got the following error:

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.

Also, each new instance of Terminal writes these messages before any command is written:

-bash: :/home/antonio/jdk7/jdk1.7.0_07/bin: No such file or directory
-bash: export: `/home/antonio/Desktop/Scala/install/sbt/bin:/home/antonio/jdk7/jdk1.7.0_07/bin': not a valid identifier

I recently did a manual installation of the jdk 7, which apparently works:

java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

While setting up Sbt, I made the mistake of editing bashrc by writing gedit ~/.bashrc on my terminal instead of writing gedit .bashrc, I wrote the following lines at the end of the bashrc file that opened:

export PATH=/PATH/TO/YOUR/jdk1.7.0-VERSION/bin:$PATH
export PATH=/home/antonio/jdk7/jdk1.7.0_07/bin:$PATH

What is wrong here?

How can I access my bashrc file and modify it again?


copy the .bashrc from your /etc/skel to your home then restart

sudo cp /etc/skel/.bashrc /home/your-user

create a new user and copy the .bashrc in its home directory to your home directory

sudo cp /home/newuser/.bashrc /home/myuser/

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.