Find the answer to your Linux question:
Results 1 to 8 of 8
Hello I inserted some code in my .bashrc file and have screwed up myself. I want to get the .bashrc file as it was before. HELP!!...
  1. #1
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    [SOLVED] Messed up .bashrc how to get orignal back

    Hello
    I inserted some code in my .bashrc file and have screwed up myself. I want to get the .bashrc file as it was before. HELP!!
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Quote Originally Posted by vickey_20 View Post
    Hello
    I inserted some code in my .bashrc file and have screwed up myself. I want to get the .bashrc file as it was before. HELP!!
    Well, no idea what distro you're using, but even so, I don't know their defaults, but here is my very basic one minus aliases.

    Code:
    # Check for an interactive session
    [ -z "$PS1" ] && return
    
    alias ls='ls --color=auto'
    PS1='[\u@\h \W]\$ '
    
    if [ -f /etc/bash_completion ]; then
        . /etc/bash_completion
    fi

  3. #3
    Linux Newbie egan's Avatar
    Join Date
    Feb 2009
    Location
    Mountain View, CA
    Posts
    132
    Perhaps look /etc/skel/.bashrc? /etc/skel is where most distros put the default files that get copied to a new user's directory.

  4. #4
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    thanks for replying guys

    I was exactly looking for this file /etc/skel/.bashrc. Thanks for helping me out
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  5. #5
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    Quote Originally Posted by egan View Post
    Perhaps look /etc/skel/.bashrc? /etc/skel is where most distros put the default files that get copied to a new user's directory.
    If thats not the case for you then try
    Code:
    useradd -D
    adduser -D
    as root ... they should display default information for new users, I think SKEL=.... will indicate the default files location.

  6. #6
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    Quote Originally Posted by Jonathan183 View Post
    If thats not the case for you then try
    Code:
    useradd -D
    adduser -D
    as root ... they should display default information for new users, I think SKEL=.... will indicate the default files location.
    How to use it exactly. I tried
    Code:
    adduser -D vickey
    Where vickey already existed , will it overwrite default files. It displays the help menu in the above code case.
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  7. #7
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    Quote Originally Posted by vickey_20 View Post
    How to use it exactly. I tried
    Code:
    adduser -D vickey
    Where vickey already existed , will it overwrite default files. It displays the help menu in the above code case.
    Use
    Code:
    adduser -D
    thats it ... it will display defaults or you can use the command to change defaults - but I don't recommend it
    Code:
    man useradd
    first !

    I expected you to use adduser -D to find the default files location (usually /etc/skel) and then manually copy .bashrc from there to your user home area to restore things to how they would be when the user was created

  8. #8
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    thanks

    Thanks I copied the files form /etc/skel/ and its working properly.
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

Posting Permissions

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