While trying to set Java home, following someone's instructions I edited ~/.bashrc in gedit, putting the java_home script at the end of the file, and then I typed source ~/.bashrc after saving in gedit.

I returned to gnome terminal and now I absolutely cannot get out of bash.

  • 1
    Could you please add a little more detail? What exactly did you do, what did you want to achieve and what happened instead? Did you encounter any warning or error messages? Please reproduce them in their entirety in your question. (see How do I ask a good question?) Sep 12, 2016 at 20:12
  • No warning or error I was following someone's instructions I can't remember exactly but... I ran ~/.bashrc and ended up in gedit and then ran the java_home script at the end of the file in gedit and then I typed source ~/.bashrc after saving in gedit I returned to gnome terminal and now I absolutely cannot get out of bash
    – nexogen.io
    Sep 12, 2016 at 20:16
  • Please edit your question if you want to add or clarify something. I'm still having a hard time to decipher the sequence of events. Maybe you can format them as an ordered list in your question to both sort your thoughts and use the text layout and structure as a support for the reader to follow them. Sep 12, 2016 at 20:35
  • I'm simply too frantic and frustrated at this point... I ran a bash script from gnome terminal now I cannot EXIT the bash script via gnome terminal. When I open gnome terminal I no longer get my normal profile. Instead It opens in BASH. The gnome terminal no longer functions the way it did before I ran the bash script. The gnome terminal is stuck in a BASH shell. How do I exit the bash shell and return to my normal gnome terminal profile?
    – nexogen.io
    Sep 12, 2016 at 20:39
  • Please calm down, go do something else for an hour or two. It's going to be very difficult to help you as long as you're this incoherent. Sep 12, 2016 at 20:43

1 Answer 1


I'm not sure what you put in your .bashrc but I suspect it is sourcing itself recursively. To reset it to the default, use a GUI method, since you can't use the command line.

The most reliable way would be just to overwrite your broken .bashrc with the system default version.

  • Open Nautilus (the file browser)
  • under View click Show hidden files.
  • Rename your .bashrc to something else like bashrcbroken.
  • Navigate to the directory etc in filesystem
  • go into the etc directory and then go into the skel directory.
  • Right click & copy the file .bashrc.
  • Go back to your user home directory and paste the file there, replacing the old .bashrc file.

Open a new terminal.

  • You are the only one who seems to get what I am talking about omg this is beyond aggravating... I added java_home environment variable to .bashrc as this is what so many said to do... I have been using Linux for years and I stopped for a while and now I'm in bash hell I forgot what to do... I used to go in and out of bash all the time... I have no idea why it is so difficult...
    – nexogen.io
    Sep 12, 2016 at 20:43
  • have you fixed it now @nexogen.io ? Yes, a lot of people seem to have problems with this - I see some strange looking tutorials and commands floating around
    – Zanna
    Sep 12, 2016 at 20:45
  • No I am having a lot of issues
    – nexogen.io
    Sep 12, 2016 at 20:47
  • Did you try what I suggested and it didn't work @nexogen.io ?
    – Zanna
    Sep 12, 2016 at 20:48
  • 1
    no don't do that, just copy .bashrc from skel and paste it in your user home directory, overwriting the old .bashrc that is there @nexogen.io
    – Zanna
    Sep 12, 2016 at 20:50

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