Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.