|||
方法一:
在终端中输入: $ open [path of a text file] -a [path of the program]
Geany
$ open [path of a text file] -a /Applications/Geany.app
Sublime Text
$ open [path of a text file] -a /Applications/Sublime\ Text.app 注:空格的表示法为\空格。
方法二:
1. 在.bashrc文件中添加如下路径并保存。
# Geany
export geany=/Applications/Geany.app/Contents/MacOS
export PATH=\$geany:\$PATH
# Sublime Text
export subl=/Applications/Sublime\ Text.app/Contents/SharedSupport/bin
export PATH=\$subl:\$PATH
2. 重新打开一个终端,输入如下命令就可以用对应的编辑器打开文本文件了。
$ geany [path of a text file]
$ subl [path of a text file]
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-18 14:22
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社