Robottdag
Robottdag

Reputation: 411

Use terminal to open a file by Excel on Mac

Now, in MacOS terminal: I can open a file by Sublime Text just by running:

subl [path]

Can I do something of the kind when using Excel?

Thanks

Upvotes: 16

Views: 16977

Answers (1)

Robottdag
Robottdag

Reputation: 411

Open a file by default application, just

open [path]

If want to change, can use

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

From the man open page (more info on the -a option):

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

Upvotes: 25

Related Questions