新手问题 在 Mac 系统命令行中 subl .无效

ckl · 2014年04月12日 · 最后由 tianbymy 回复于 2019年04月03日 · 10321 次阅读

mac OSX10.9 系统,在终端使用 subl 命令无效,调不出 sublime 出来,显示 command not found。如何解决?

#1 楼 @Juanito 我安装了 3 但是还是不行,

#2 楼 @ckl Assuming you've placed Sublime Text in the Applications folder, and that you have a ~/bin directory in your path, you can run:

我翻译下:

假设你的 Sublime Text 安装在 Applications 目录,并且你将 ~/bin 目录放入 PATH 中,你可以运行 xxxx

echo $PATH 看下,是不是缺了 ~/bin ?

在.bashrc 中加入一行

export PATH="~/bin:$PATH"

alias subl='open -a "Sublime Text 2"'

这样是可以滴

#3 楼 @ninehills 你说的是可以的,但是我重新打开终端,有无法打开了

明显的命令行新手,还要使用命令行。。。

sudo ln  -sf   /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl   /usr/local/bin/ 
需要 登录 后方可回复, 如果你还没有账号请 注册新账号