如果文件已被指定默认程序
open httpd.conf
指定一个特定程序打开文件
# 用 sublime text 打开 httpd.conf open -a /Applications/Sublime\ Text.app/ httpd.conf
如果使用频繁,还可以添加软连接
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/sublime
输入sublime
就可以打开 sublime text
输入sublime httpd.conf
就可以用 sublime text 打开文件