I am trying to follow this explanation of how to make an alias and made the following .bashrc file in my home directory. Here it is:
# .bashrc
# User specific aliases and functions
alias py='python3'
alias pip='pip3'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PATH=$PATH:/home/username/bin:/usr/local/homebrew
export PATH
I restarted my shell and ran "py" and got a "command not found" error. What am I doing wrong? Thanks
I tried the following as well:
# .bashrc
# User specific aliases and functions
alias py='/usr/bin/python3'
alias pip='/usr/bin/pip3'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PATH=$PATH:/home/username/bin:/usr/local/homebrew
export PATH
as well as:
# .bashrc
# User specific aliases and functions
alias py='/usr/local/bin/python3'
alias pip='/usr/local/bin/pip3'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PATH=$PATH:/home/username/bin:/usr/local/homebrew
export PATH
Both of these also gave a "command not found" error.
whereis python3
then read the full path of the binary and provide this full path to your alias – cmak.fr May 15 '20 at 02:51ls -l /usr/local/bin/python3
give you. – May 15 '20 at 06:18lrwxr-xr-x 1 mathewlewis admin 34 14 May 02:37 /usr/local/bin/python3 -> ../Cellar/python/3.7.7/bin/python3
– Mathew May 15 '20 at 22:26