Find the answer to your Linux question:
Results 1 to 4 of 4
Hey everyone, This has got to be an easy fix, but for the life of my I cannot think of it. I want to create an alias that goes to ...
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    43

    Exclamation Alias problems - gone after logout

    Hey everyone,

    This has got to be an easy fix, but for the life of my I cannot think of it. I want to create an alias that goes to my log files, and when I am done, I have one that goes back to my current logged in users home directory. This is what they look like:

    Code:
    alias logs="cd /var/log/"
    alias home="cd ~"
    So this works great . My problem is it doesn't work after logout of server. In other words, I have to recreate it everytime I login again. As this fix could be fixed using a login script, personally I thought maybe there could be a permanent fix; could be wrong.

    Let me know your thoughts, please? Thanks in advanced.

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    add this code in .bashrc file in your home folder.





    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    I'm just jumping in to point out that typing cd with no arguments takes you to your home directory, the same as cd ~. But if it's easier to remember the home alias, or just more comfortable to use, then by all means go for it.
    Stand up and be counted as a Linux user!

  4. #4
    Just Joined!
    Join Date
    Jan 2006
    Posts
    43
    @devils_casper
    Thanks ... duh. Again, like I said, easy fix, just not into I guess. I appriciate it.

    @Zelmo
    As this is easy and all. I figured I would create aliases that i didn't have to think of. Even though using cd is shorter and I use cd LOTSSSSSS I wanted something i don't even have to think about. Where am I going? Oh. .. yea .. home.

    Same with logs, only this one makes more sense. So, as a sysadmin, i use these just as "quickies" so that I don't have to think.

    Some people like to type cd. Some like to type cd ~. Shoot, some people like to type cd /home/drew I prefer a method of, .. home

    Alright guys, I'm out ... thanks for the help.

Posting Permissions

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