Search code examples
bashaliassymlinkdotfiles

How to symlink alias and function dotfiles


I trying to make my own alises. I have this in my ~/dotfiles:

alias hello="echo Hello"

I try to symlink this:

ln -sn "~/dotfiles/.alias" ~

But after this when i run my alias nothing happens Is there a path for aliases in home to symlink it?


Solution

  • Make sure you are sourcing your aliases file in your .bashrc or .zshrc

    the code for that in your .bashrc or .zshrc should look something like this:

    if [ -f ~/dotfiles/.aliases ];
    then source ~/dotfiles/.aliases
    fi