我正在尝试关注这解释如何创建别名,并在我的主目录中创建以下 .bashrc 文件。它在这里:
# .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
我重启了 shell 并运行了“py”,结果出现“未找到命令”错误。我做错了什么?谢谢
我也尝试了以下操作:
# .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
也:
# .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
这两者都出现了“未找到命令”的错误。