Is there a way to return to the command line after opening the application through it?

I want to be able to open the application on the command line, but instead of switching to the application, I want to stay on the terminal emulator. Is there a way to do this? I am using OS X.

+3


source to share


3 answers


Use a flag -g

open

that avoids bringing the application to the fore.

$ open -g /Applications/TextEdit.app
$

      



open

will launch the application and then return to the command line.

+2


source


After starting the program, press ctrl+z

and enter bg

. You will be returned to your terminal CLI.



Whenever you want to return to your program, just type fg

.

0


source


You can do a background job. In the Bash shell, this is done with &

. For example:

some_script_or_application &

      

Note that some daemons and processes are on their own. For example, on OS X, launch open some.pdf

will view the PDF in a GUI, returning immediately the command line without having to do anything special.

See the GNU Bash manual for job management for background jobs for details .

0


source







All Articles