excel - 在 Mac 上使用终端通过 Excel 打开文件

标签 excel macos shell command-line terminal

现在,在 MacOS 终端中:我只需运行以下命令即可通过 Sublime Text 打开文件:

subl [path]

使用 Excel 时我可以做类似的事情吗?

谢谢

最佳答案

使用默认应用程序打开文件,只需

open [path]

如果想改变,可以使用

open -a [app-path] [file-path]

man open 页面(有关 -a 选项的更多信息):

DESCRIPTION
     The open command opens a file (or a directory or URL), 
     just as if you had double-clicked the file's icon. If no application name
     is specified, the default application as determined via LaunchServices is 
     used to open the specified files.

     If the file is in the form of a URL, the file will be opened as a URL.

     You can specify one or more file names (or pathnames), 
     which are interpreted relative to the shell or Terminal window's current 
     working directory. 
     For example, the following command would 
     open all Word files in the current working
     directory:

     open *.doc

     Opened applications inherit environment variables just 
     as if you had launched the application directly through its full path.  
     This behavior was also present in Tiger.

     The options are as follows:

     -a application
         Specifies the application to use for opening the file

关于excel - 在 Mac 上使用终端通过 Excel 打开文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47824438/

相关文章:

linux - 处理 FTP 中的日期

vba - 无法访问 iframe 中存储的内容

macos - 在 Bash 中获取在 Mac OS X 上运行的应用程序列表?

bash - 在 bash 脚本中使用 sed 从文件中删除一行

macos - 有哪些方法或工具可用于检查 Mac 桌面应用程序中的元素

macos - 为什么 zsh 中只有某些插件可以工作,而其他插件不能?

bash - 如果 bash 脚本或它创建的任何后台作业发生错误,则退出

vba - 如何检查对象是否支持vba中的方法?

数据库架构生成器

arrays - 如何更改数组vba中的现有数据