I have a terminal window and am ssh'ed into a server, possibly running tmux. Both the remote server and my local computer have the same view of the filesystem I am working on. I would like to be able to type certain commands like nautilus or subl (sublime text) in the remote terminal and have that command execute on the local computer, in the same directory. What is the easiest way to set up something like this?

I have X forwarding set up correctly, but to be clear, I do not want to run these certain commands on the remote server and have them forwarded - I want to spawn a new process on the client, using the pwd from the server.

I could program a deamon and run it on the client, and have my command on the server connect to it, but it would be tricky to set up (with firewalls etc.). It would be great if I could somehow piggyback on the ssh or X forwarding connection somehow. Any suggestions?

  • short of having a local custom listener on an obscure port and a program running on the remote computer, sending commands to the locally listening port, I can not think any off-the-shelf software, capable of doing what you want. It is rather an unusual setup. No ?
    – MelBurslan
    Mar 23, 2016 at 14:51

1 Answer 1


In short, what you're trying to do can't be done in the way you're trying to do it. You can, however, open a new local terminal window, or a new tab in your existing terminal window, and run those programs locally against the local view of the filesystem. If this is a common NFS filesystem, that will get you where you want to be. If it is a different filesystem with identical contents, you'll have to work out some way of merging the local changes to the remote copy, which could be as simple as an rsync.

You must log in to answer this question.

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