[英]Command to open Sublime from OSX terminal
有没有办法从 OSX 终端使用 Sublime 打开文件:
在 Linux 中就像这样,但在 OSX 中是这样的:
gedit file.txt
您还可以创建一个指向 Sublime Text 的符号链接,以使用“sublime path ”之类的简单命令从终端启动它:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
您应该相应地更改安装路径。 也可以使用 sublime 以外的任何其他别名,但最好是明确的。
您可以使用通用命令通过应用程序打开文件,例如:
open -a Sublime.app file.txt
这应该有效:
open /Applications/Sublime\ Text.app
如果您想保留sublime
作为别名以供将来使用,您可以将其添加到您的.bash_profile
中:
echo "alias subl=\"open /Applications/Sublime\ Text.app\"" >> ~/.bash_profile
source ~/.bash_profile
sublime
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.