Celeb Glow
updates | March 29, 2026

trying to make bash alias on mac

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.

4 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy