Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 6 down vote accepted

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

sudo cp /etc/skel/.bashrc /home/your-user
share|improve this answer

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

sudo cp /home/newuser/.bashrc /home/myuser/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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