10

I have create few new aliases in ~/.bashrc then run source ~/.bashrc and it worked. But after restart terminal it does not work. I looked back and found the advice: create ~/.bash_aliases and in ~/.bashrc append string:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

But the problem remains unsolved. Any suggestions?

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
Eugene
  • 205
  • 1
  • 2
  • 6
  • Type "alias" to see the list of all your assigned alias. Do you see your alias in the command output? – Flint Jul 07 '12 at 09:59

1 Answers1

9

Possibly your terminal starts a login shell. In this case not .bashrc is read, but bash looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order.

try man bash and search for INVOCATION to read more.

It may be useful to source .bashrc in your .bash_login.

ohno
  • 823
  • 4
  • 9