Using Alias in putty and linux

Discussion in 'Computers and Technology' started by don_bocci, Jan 30, 2008.

Using Alias in putty and linux

Discussion in 'Computers and Technology' started by don_bocci, Jan 30, 2008.

  1. don_bocci

    don_bocci New Member

    Joined:
    Dec 3, 2007
    Messages:
    207
    Likes received:
    0
    Trophy points:
    0
    Ok so if you are familiar with these interfaces alias is command for making shortcuts

    EX:
    alias d='cd /home/user/Documents'

    would make d execute cd /home/user/Documents without having to type all that in.

    So heres my problem:

    I make my alias and they work fine and dandy, but after I logout and log back in again my aliases are gone. So I wanted to know if anyone knows where I could save the aliases so that they won't disappear after I log out.
     
  2. 11-Sodium

    11-Sodium New Member

    Joined:
    Dec 17, 2007
    Messages:
    194
    Likes received:
    0
    Trophy points:
    0
    What you need to do is make a .bashrc file in your home directory on the remote machine using a text editor such as emacs or vim and include any aliases in that file, as well as any other preferences that you want to set permanently, and be sure to save it in the home directory.

    edit: Should have read title, mentioned linux
     
  3. don_bocci

    don_bocci New Member

    Joined:
    Dec 3, 2007
    Messages:
    207
    Likes received:
    0
    Trophy points:
    0
    Well its mostly for the putty, because I am accessing my account at schools through putty so basicly I write up a text that reads something like

    alias d='cd /home/user/Documents'
    alias ..='cd ..'
    etc


    and then save that to my home directory as a .bashrc and it will save my alias
     
  4. BirdofPrey

    BirdofPrey New Member

    Joined:
    Aug 20, 2007
    Messages:
    4,985
    Likes received:
    5
    Trophy points:
    0
    From:
    Arizona
    Are you acessing the school from home or your home PC from school because most school computers have the harddrive encripted so you can't save on them so you would have to save everything to a USB flash drive
     
  5. don_bocci

    don_bocci New Member

    Joined:
    Dec 3, 2007
    Messages:
    207
    Likes received:
    0
    Trophy points:
    0
    Well its my account at my school and I already know I can write stuff to it because I login through putty with the same account and password I do to log in to the my school account. So the only issue is how I am to save it so as long as the example I described works then we are good
     
  6. BirdofPrey

    BirdofPrey New Member

    Joined:
    Aug 20, 2007
    Messages:
    4,985
    Likes received:
    5
    Trophy points:
    0
    From:
    Arizona
    Do me a favor. Save a text file to the hard drive of your school computer and then log off ad then back on and tell me if it is still there.

    Usually the remote acess is tied to your school account and stored on a central server so it has nothing to do with saving to the hard drive.

    The problem is that the OS be it Linux or Unix usually stored on a central server with unmodifiable files and then they just give you private access space.
     
  7. Fenix

    Fenix Moderator

    Joined:
    May 21, 2007
    Messages:
    6,769
    Likes received:
    11
    Trophy points:
    0
    a lot of schools now adays have a private FTP server as well, with accounts for all students. I'd check into that, see if yours does.
     
  8. don_bocci

    don_bocci New Member

    Joined:
    Dec 3, 2007
    Messages:
    207
    Likes received:
    0
    Trophy points:
    0
    Thanks for all the input and WSU Vancouver does have a private FTP server which as I said is not the problem as I fixed everything. What i did was create a text file and then I put my aliases in it then saved it as a .bashrc file and used FTP lite to transfer it to my account. And then when I open the putty I just run my file with the aliases and it loads all of them. Thanks guys for the help.