Add the command to your ~/.bashrc
. Technically, you should be able to add to ~/.profile
as well, from man bash
, INVOCATION
documentation:
If bash is invoked with the name sh
, it tries to mimic the startup behavior of historical versions of sh
as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the --login
option, it first attempts to read and execute commands from /etc/profile
and ~/.profile
, in that order.
Also:
Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the remote shell daemon, usually rshd
, or the secure shell daemon sshd
. If bash determines it is being run in this fashion, it reads and executes commands from ~/.bashrc
and ~/.bashrc
, if these files exist and are readable.
So, this means that if you're logged in locally you should be OK using ~/.profile
; but, if you ssh to systems then you'll want to use ~/.bashrc
. ~/.bashrc
also applies when logged in locally; so, it has just become convention to use that.
Why do you want to do this? When you open a new terminal, this command is already executed. – Spack – 2013-05-04T01:27:44.240
No its not. I need this because of a bug in some development environment I use. The
--login
flag is crucial. – if __name__ is None – 2013-05-04T01:51:20.793