Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, In which file do I create 'alias'es so that they're permanent everytime that I login? Example: alias lst='ls -la | more' And in that specific file at what location ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Aug 2003
    Posts
    113

    Aliases question?


    Hello,

    In which file do I create 'alias'es so that they're permanent everytime that I login?

    Example: alias lst='ls -la | more'

    And in that specific file at what location do I insert the 'alias'es text command/arguments. Top or Bottom? Can't seem to find any specifics on this and I don't want to start altering scripts that effect my environment...


    I've noticed that I have some default 'alias'es already configured. I know how to 'unalias' these during that shell's session but how do I 'unalias' so that the changes are permanent?

    I can't seem to find the file that holds these default 'alias'es. If there is one?

    Thanks,
    JB

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I suggest that you put it in ~/.bashrc.

  3. #3
    Linux Newbie
    Join Date
    Aug 2003
    Posts
    113
    Thanks for the response Dolda2000.

    You said:
    >I suggest that you put it in ~/.bashrc.

    My response:
    >Can you explain the reasoning behind this please?

    Thanks,
    JB

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Oh, sorry, I'm just so used to it. ~/.bashrc is sourced whenever a shell that is not a login shell is started. When a login shell is started, it sources ~/.bash_profile, but ~/.bash_profile usually chain-sources ~/.bashrc. Therefore, I think ~/.bashrc is the best choice. bash(1) explain this in more detail.

  6. #5
    Linux Newbie
    Join Date
    Aug 2003
    Posts
    113
    Thanks for the reply Dolda2000.

    I'll do my homework.

    Appreciate it.

    Thanks,
    JB

Posting Permissions

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