Mac OS 添加 alias
# alias 别名
vim ~/.bash_profile
# wq保存后回到命令行执行以下命令使其生效
source ~/.bash_profile
# Mac OS命令行下使用SublimeText打开文本文件
alias subl="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
#如果不添加别名,也可以选择将路径添加到环境变量下。
#这里的路径根据实际情况可能会有所不同。
wq保存后回到命令行执行以下命令使其生效:
source ~/.bash_profile
#这里我们假设在命令行用SublimeText打开.bash_profile,则执行如下:
subl ~/.bash_profile
参考: 苹果系统或Linux系统设置 别名alias
https://jingyan.baidu.com/article/d45ad148e801c769552b800c.html