Results 1 to 10 of 22
Hi,
recently I did some changes to my bashrc file the changes are as follows
export JAVA_HOME=/usr/java/jre<version>/bin/
export PATH=$PATH:/usr/java/jre<version>/bin
now I'm unable even login to the OS.
any methods to ...
- 05-30-2011 #1
Edited bashrc File now I cant Login and Execute Linux Commands
Hi,
recently I did some changes to my bashrc file the changes are as follows
export JAVA_HOME=/usr/java/jre<version>/bin/
export PATH=$PATH:/usr/java/jre<version>/bin
now I'm unable even login to the OS.
any methods to correct my changes pls?
thanks
amthaLast edited by amithad; 05-30-2011 at 12:59 PM.
- 05-30-2011 #2Just Joined!
- Join Date
- Apr 2011
- Posts
- 3
It seems you need to remove the edits you added to bashrc. Can you log in as root? IF so you can edit it from there. Otherwise, use a live CD or DVD such as Knoppix or Mint and you should be able to edit the file.
Hope that helps.
- 05-31-2011 #3Just Joined!
- Join Date
- Jul 2010
- Posts
- 19
- 06-01-2011 #4
Thanks
Hi all,
Thanks for your suggestions. I'll try what you have suggested and give a feedback.
- 06-01-2011 #5Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
if you still can't log in as root, try this (if you don't have a LiveCD handy, which would work just fine, of course), as it's a little quicker:
Reboot, and at the grub/boot prompt, interrupt the boot process by pressing the [Tab] key, then type [A] to modify the kernel args, then append this to the end of your kernel args line:
Then press [Enter]. It should boot up and dump you right to a bash prompt. First you'll need to mount your root filesystem read-write:Code:init=/bin/sh
Then you can edit the bashrc as suggested. Then reboot.Code:mount -o remount,rw /
- 06-02-2011 #6
hi,
I was able to boot from a live CD and access the /etc/bashrc but the content in the file is different than we get by typing gedit ~/.bashrc command hence I was not able to track my changes
- 06-02-2011 #7Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
yeah, those are two different files.
The /etc/bashrc is a system-wide BASH file that gets read by anyone logging that uses bash as their shell.
The tilde in ~/.bashrc refers to your home dir, or the equivalent of the $HOME variable, which gets set when you log in. This bashrc file only gets read by this user, so usually has user-specific bash settings.
So if you were root, then the file is probably /root/.bashrc. but maybe you already know this? couldn't tell from your post...
- 06-02-2011 #8
- 06-02-2011 #9
- 06-02-2011 #10
The question is which bashrc file did you modify?
The one in /etc or the one in /home/user?
I entered the ~/.bashrc command after changing to root user prompt from my default user login. So it should be root. The thing is when I enter the username and password for my normal account the password get authenticated and of in a flash again it directs to the login page. Even when I try to log as root it doesn't allow to login.
thanks
amithaLast edited by amithad; 06-02-2011 at 05:50 PM.


Reply With Quote
