I'm on Mac using Terminal for a SSH connection a Linux server, but I guess this could apply for any OS/client.

If I'm using Terminal on my local machine I can open a file in a GUI application by doing open [appname] [filename].

Is it possible to make it that way when connected to a remote server via ssh as well?

I allready have the remote server mounted as drive, so it's accessible via /Volumes/my_server, so what I basically want to do is to, when "on the remote server" via ssh, be able to write something like openlocally [filename] which sends a command to my local terminal session, or whatever it has to be, that runs open [appname] [filename] locally.

  • 4
    why don't you just open another terminal window or tab?
    – Nikolaus Gradwohl
    Jul 2, 2010 at 11:54

1 Answer 1


I don't have a mac to check right now, but the ssh manpage says there is an escaped key combination (~^Z) that sends the ssh client to the background. Did you try it ?

  • Ah, didnt know about that one. Thanks! :) If I could create a script that would take one argument, run the ~^Z, run open [appname] $argument, and then return with fg that would be perfect. But I can't find any way to programatically trigger the suspense. Any ideas?
    – phobia
    Jul 2, 2010 at 15:31
  • @phobia: quite possibly you would still have to ~^Z to run the script on your local computer in the first place.
    – David Z
    Jul 2, 2010 at 19:08
  • I am trying to do the same, did you get any success @OMG_peanuts? Feb 12, 2015 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.