Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have added mkalias in my .bashrc file as I learnt here

function mkalias ()
        if [[ $1 && $2 ]]
        echo -e "alias $1=\"$2\"" >> ~/.bashrc
        alias $1=$2

but when I type mkalias on command line it says command not found. Why ?

share|improve this question
up vote 2 down vote accepted


$ source .bashrc

in order to read the content of the modified .bashrc file.

You can also exit and reopen the terminal to make the changes take effect.

Every time you modify .bashrc you have to source it or restart the terminal to see the effects of the modifications.

share|improve this answer

You must log in to answer this question.