Results 1 to 4 of 4

Thread: Aliases disappear and other problems

  1. #1
    Join Date
    Nov 2012
    Beans
    1

    Aliases disappear and other problems

    Hi,
    I have a number of problems with ubuntu server 12.10. Hopefully someone can help me out.
    1. I made a number of aliases (alias start.minecraft='java...) they all worked well, but when I shut the computer down overnight and switched it back on later all the aliases failed to work. I got the message command not found, or words to the effect. Similarly when I set the aliases as root they were forgotten when I went back to normal user. Also when I went back to root they had gone from there.

    2. Possibly the wrong forum, but I'll give it a go. I use no-ip.org to keep track of my ip. I've downloaded the software, but it doesn't update the ip-address. Ever. The software runs fine, but nothing happens.

    I hope someone can help me out.
    Last edited by Lutrine; November 19th, 2012 at 09:01 PM. Reason: Pressed enter at wrong point and published first line on its own.

  2. #2
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,657
    Distro
    Ubuntu

    Re: Aliases disappear and other problems

    Aliases defined in a shell only survive until it is terminated. You need to add them to ~/.bashrc or ~/.bash_aliases

  3. #3
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,657
    Distro
    Ubuntu

    Re: Aliases disappear and other problems

    Further to the previous answer

    You create a file in your home folder called .bash_aliases and put them in there.

    For example, here is a small portion of one of my .bash_aliases file

    Code:
    #Cd ripping/playing
    alias cd2flac='abcde -c ~/.abcde_flac.conf'
    alias cd2ogg='abcde -c ~/.abcde_ogg.conf'
    alias cd2mp3='abcde -c ~/.abcde_mp3.conf'
    alias cdp='mplayer cdda://'
    alias vinyl='ffmpeg -f alsa -i hw:0,0 -acodec pcm_s16le'
    
    #updating
    alias upd='sudo apt-get update'
    alias upg='sudo apt-get upgrade'
    alias dupg='sudo apt-get dist-upgrade'
    alias inst="sudo apt-get install"
    
    alias tran='transmission-cli -b -D -er -u 5 -w ./'
    alias here="PS1='${debian_chroot:+($debian_chroot)}\W\ $ '"
    alias twit='twidge lsrecent -su'
    alias punk='mplayer -really-quiet http://65.60.32.242:8600 < /dev/null &'
    alias ran='mplayer -quiet -shuffle -playlist <(find ~/Music -type f)'
    alias sq='mplayer http://192.168.0.5:9000/stream.mp3'
    Save it, then when you log back on they will all be available to you. You can use them straight away if you type
    Code:
    . ~/.bashrc
    after you save the file and after you modify it a later point.

  4. #4
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,486
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Aliases disappear and other problems

    EDIT: oops.. slow reply.. as usual.


    Hi Lutrine. Welcome to the forums

    In order to keep your aliases, save them in a file called ~/.bash_aliases

    That is a file called .bash_aliases, locate on your home.

    Let us know how it goes.
    Regards.

Bookmarks

Posting Permissions

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