First you need to find where it is.
locate pip
You're looking for the binary so you want to narrow it down to ..../bin/.... paths, generally.
locate pip | grep bin
As an alternative to the above, if you can run pip
while under sudo, try running sudo which pip
to give you the path to it.
Once you find something promising (mine is /usr/bin/pip
, for example), open up ~/.bashrc
and add a line alias pip=your/bin/path
. Then you have to update bash's source so do source ~/.bashrc
and you should be able to run pip
.
As a sidenote, I (and many others) prefer to keep all of my alias
definitions in a separate file to keep things clean, so I use ~/.bash-aliases
for all of my alias definitions and then in ~/.bashrc
you want these lines:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
Which pulls all the aliases out of ~/.bash-aliases
for you.