I have added one line in bashrc and after that terminal is not working as expected, no path is showing and I am unable to run any command: Below line i have added in bashrc:
. ~/.profile
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThe line you added tells ~/.bashrc
to source ~/.profile
. However, Ubuntu's default ~/.profile
is set up to source ~/.bashrc
. So you just set up an infinite loop: ~/.bashrc
is sourcing ~/.profile
which is sourcing ~/.bashrc
which is sourcing ~/.profile
and so on, for ever. Since ~/.bashrc
is read every time you open a new terminal, it enters this infinite loop, never exits and therefore leaves you with the problem you see.
Since you can log in graphically, just use a GUI editor to remove the line, as others suggested, and you will be OK.
Edit .bashrc
using a GUI editor, geany for example, and remove the line you added. There must be some GUI editor installed by default in Ubuntu.
~/.bashrc
. It's the user's bashrc, not the global /etc/bash.bashrc
. Try to edit this file.
/etc/bash.bashrc
. Open the file browser and press Ctrl+H to show hidden files. You should see .bashrc
right there in your home directory. Click to open with Gedit or whatever text editor wants to open it and remove that line you added.
New start (I really have not the ability of multitask). Boot in recovery-mode
mv /home/your-user-name/.bashrc home/your-user-name/.bashrc.bak
afterwards cp the default file
cp /etc/skel/.bashrc /home/your-user-name/.bashrc
Then you have to change ownership of that new file.
chown your-user-name:your-user-name /home/your-user-name/.bashrc
reboot.