Problem in .bashrc

You've probably messed up your .bashrc file and now you can't open a terminal anymore, because this file is used to set up your shell.

  1. Boot into recovery mode. How do I boot into recovery mode?

  2. Remount your system with write access:

    sudo mount -o remount,rw /
    
  3. Copy the pristine .bashrc file from /etc/skel into your homedir to fix this. See Where are the pristine, untouched contents of a ~/.profile file? (also answers .bashrc), e.g.:

    cp /etc/skel/.bashrc ~username/
    chown username: ~username/.bashrc
    

If you are still logged in, or can login to the graphical session without problems, then you can copy the file /etc/skel/.bashrc to your home directory (be aware that hidden files are not shown by default in the file manager.

As an alternative, press F2 then launch the command

cp /etc/skel/.bashrc /home/your-username

If these methods do not work, then you have to follow the method shown by @gertvdijk.