【笔记】Open学习笔记

前言

open is a NeXTSTEP and macOS command line process that opens files, folders or URLs in the GUI as though the user had double clicked on them. Files will be opened in the default application for their type, folders will be opened in the Finder or file system GUI, and URLs will be opened in the default browser.(维基百科

MacOS终端通过open命令打开文件或访问URL

打开文件

-a /Applications/<application_name>.app:通过指定应用程序打开文件
-b <identification>:通过指定软件包标识符打开文件
-e:使用默认文本编辑器打开文件,等价于-a TextEdit

1
open <file>

访问URL

-a /Applications/Safari.app:通过指定应用程序打开URL

1
open <url>

完成

参考文献

知乎——半生在世
CSDN——长剑耿介
知乎——Gary Guo
虹墨空间站