Find the answer to your Linux question:
Results 1 to 3 of 3
I'm running Vector Linux 5.9.1 SOHO and I'm trying to make the following alias permanent. Code: alias rm='rm -r' I've tried to edit my .bashrc file, adding a line with ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! arkolyte's Avatar
    Join Date
    Oct 2008
    Location
    Troutville, Virginia
    Posts
    14

    [SOLVED] Creating permanent aliases.


    I'm running Vector Linux 5.9.1 SOHO and I'm trying to make the following alias permanent.

    Code:
    alias rm='rm -r'
    I've tried to edit my .bashrc file, adding a line with the command, but it didn't work, so I came to the conclusion that I have no idea what to put in there. Thanks in advance for any help with this. The current contents are:

    Code:
    # .bashrc
    # sourced by BASH everytime it start
    # Set various environment variables
    
    ## These should be set by /etc/profile
    ## But sometime, bash missed them. So here is the push
    export PATH="/usr/local/bin:/usr/bin:/usr/sbin:/bin:/opt/bin:/usr/X11/bin:/usr/local/games:/usr/games:/opt/Adobe/Reader8/bin/"
    for SH in /etc/profile.d/*.sh; do
       . $SH
    done
    
    #use custom keymap
    xmodmap ~/.Xmodmap
    
    
    ## Set a default shell prompt:
    ## A complete one
    #PS1="${PS_CYAN}\h:/\w\n${PS_NORMAL}\u:\\$ "
    #PS2="> "
    
    ## Standard with color
    ## This is the plain standard prompt
    #PS1="${PS_DGREEN}\u${PS_YELLOW}@${PS_DGREEN}\h:\\$ ${PS_NORMAL}"
    #PS2="> "
    
    ## This is the plain standard prompt
    #PS1="\u@\h:\\$ "
    #PS2="> "
    
    ## Set fancy colors
    eval `dircolors -b`
    
    ## Set this for your first choice
    export BROWSER=seamonkey
    #export BROWSER=firefox
    #export BROWSER=opera
    #export EXPLORER=konqueror
    #export NETWORK_EXPLORER=konqueror
    #export AUDIO_PLAYER=xmms
    #export VIDEO_PLAYER=gxine
    export DISPLAY=$DISPLAY
    
    #let root use gui
    if  /usr/bin/tty >/dev/null; then
      xhost +si:localuser:root
    else
      xhost +si:localuser:root >/dev/null 2>&1
    fi
    
    
    # This line was appended by KDE
    # Make sure our customised gtkrc file is loaded.
    #export GTK2_RC_FILES=$HOME/.gtkrc-2.0

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Adding that code at the end of .bashrc file should work. Did you execute source .bashrc command after editing file?

    Edit file :
    Code:
    alias rm='rm -r '
    Execute this
    Code:
    source .bashrc
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined! arkolyte's Avatar
    Join Date
    Oct 2008
    Location
    Troutville, Virginia
    Posts
    14
    Yep, that worked. I'm still pretty new to Linux, didn't know about the source .bashrc thing. Thanks a bunch!

Posting Permissions

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