Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
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 ...
  1. #1
    Just Joined! amithad's Avatar
    Join Date
    Sep 2006
    Posts
    64

    Question 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

    amtha
    Last edited by amithad; 05-30-2011 at 12:59 PM.

  2. #2
    Just 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.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    19
    Quote Originally Posted by amithad View Post
    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


    amtha
    I cannot find it at the moment but I seem to remember this issue somewhere else, and it was an issue with a 64 bit OS and java not being compatible. It might be worth checking when you get it fixed

  4. #4
    Just Joined! amithad's Avatar
    Join Date
    Sep 2006
    Posts
    64

    Smile Thanks

    Hi all,

    Thanks for your suggestions. I'll try what you have suggested and give a feedback.


  5. #5
    Linux 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:
    Code:
     init=/bin/sh
    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:
    mount -o remount,rw /
    Then you can edit the bashrc as suggested. Then reboot.

  6. #6
    Just Joined! amithad's Avatar
    Join Date
    Sep 2006
    Posts
    64

    Unhappy

    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

  7. #7
    Linux 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...

  8. #8
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Quote Originally Posted by moksha View Post
    I cannot find it at the moment but I seem to remember this issue somewhere else, and it was an issue with a 64 bit OS and java not being compatible. It might be worth checking when you get it fixed
    These are just paths and should not stop you from logging in.
    I think the bigger issue is what did he also include/remove from the original file?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  9. #9
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Quote Originally Posted by amithad View Post
    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
    The question is which bashrc file did you modify?
    The one in /etc or the one in /home/user?

    And the most important question did you make a backup before changing the file?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  10. #10
    Just Joined! amithad's Avatar
    Join Date
    Sep 2006
    Posts
    64

    Smile

    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

    amitha
    Last edited by amithad; 06-02-2011 at 05:50 PM.

Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...