Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 edited .bashrc file with PATH value, but when I open a new terminal after this, none of command is working.

When i am opening a new terminal its giving :

bash: export: `/usr/lib/java/jdk1.7.0_51': not a valid identifier
bash: export: `=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/shilpa/sqllib/bin:/home/shilpa/sqllib/adm:/home/shilpa/sqllib/misc:/home/shilpa/sqllib/db2tss/bin:/bin': not a valid identifier
bash: export: `/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/shilpa/sqllib/bin:/home/shilpa/sqllib/adm:/home/shilpa/sqllib/misc:/home/shilpa/sqllib/db2tss/bin:Downloads/hadoop-1.2.1/bin': not a valid identifier

shilpa@ubuntu:~$ ls
bash: ls: No such file or directory

Please help me with this.

share|improve this question
2  
Can you post the contents of your .bashrc? – chaos Feb 23 '14 at 21:39

In your current shell, reset a basic working path: PATH=/bin:/usr/bin

Then edit your .bashrc. Make sure when you're assigning to your path, that you don't make one of these mistakes:

  • use a dollar sign on the left hand side: $PATH=/foo:... # don't do this
  • allow spaces around the equal sign: PATH =/foo:... # don't do this
share|improve this answer

Probably you messed up the .bashrc file in your home directory.

Check it for errors or make a backup copy of the file and replace it with the example copy in /etc/skel/.bashrc

share|improve this answer
    
-1 if I could. He may have added a bunch of stuff to his .bashrc, which would be lost then. I assume he just messed up the line setting $PATH. I am optimistic: He probably does not have to start with a new .bashrc. (Although to give a better answer than this one, we would need the contents of his .bashrc, of course). – Keba Feb 23 '14 at 21:46
    
@Keba replacing isn't necessary , one could just rename the original .bashrc the user had to something else like .bashrc.bak. That way functions and aliases are not lost entirely, one could still copy them over , while in the process of fixing whatever may have caused the isue. – Serg Jan 3 at 9:39

You have add some wrong code inside the bashrc file. Just type following raw in a new terminal. if it gives errors do it twice.

PATH=/bin:/usr/bin
share|improve this answer

There is /usr/share/base-files/dot.bashrc which is the .bashrc that comes by default for every user, and users then can edit their own $HOME/.bashrc. In addition to Glenn's suggestion, you could rename .bashrc as .bashrc.bak, open Nautilus, copy over /usr/share/base-files/dot.bashrc , rename it to .bashrc. That way you have default settings back, and you can deal with undoing changes in your original .bashrc later.

Even moving files isn't quite necessary. bash has option --rcfile file which allows specifying which file to use for personal settings, so you could even do this in terminal /bin/bash --rcfile /usr/share/base-files/dot.bashrc . That will give you back bash with proper environment and access to all the tools the way you are used to them, and of course opportunity to fix the original file.

share|improve this answer

Your Answer

 
discard

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.