14

I appreciate the "open" terminal command to launch OS X apps. When invoking the open command for any purpose, it is overwhelmingly likely that I will have at least one other command I would like to type into the terminal before tending to the application I have just summoned.

How do I keep focus on the terminal when using the open command?

  • Instead of piping through grep, have you just read the manage for open? – user3439894 Apr 29 '15 at 3:41
  • 1
    In deed I missed the -g option when I read through it the first time. I only started grepping when I ran out of ideas. Thank you. – ProductionValues Apr 29 '15 at 3:49
18

Use the -g flag.

From the man page:

-g Do not bring the application to the foreground.

Example: To open the folder at your current path, behind the current Terminal window:

open . -g

As a side note, it is often better to manually peruse the documentation for new commands, as the verbiage may be different from what you expect:

i.e. "Do not bring the application to the foreground." vs. "Maintain terminal window focus."

  • 1
    Thanks, I did give the man page a good read through, though apparently I fell short of a good perusal. I did try a few others other than 'focus', like 'background', but 'foreground' never occurred to me. – ProductionValues Apr 29 '15 at 3:51
  • No worries! It happens to the best of us! :) – ryebread Apr 29 '15 at 4:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .