Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Quite often when I’m accessing a remote shell via ssh, I’d like to have a look at some files not only with the remote computer’s vi but maybe with my own MacVim or some other program.

Not necessarily because I want to use more graphically orientated programs but because I can still use the very same shell after having opened a window and don’t need to open another ssh session just because the first ssh session is occupied with showing me vi.

Of course via X forwarding I could use that system’s graphical tools – however this tends to be rather slow and apart from that it is usually quite ugly.

So my question would be: Is there some sort of escape command to use when I’m in a remote shell that allows for using my local tools transparently inside that remote working directory?

share|improve this question
Not free but I love it (I use the windows version) It transparently maps remote file systems as local drives. – Nifle Jan 28 '10 at 22:40
up vote 3 down vote accepted

While it's not exactly what you describe sshfs will let you use your local tools on remote files. It lets you mount a remote directory via ssh. So you could use macvim on a file that lives on another machine.

You can get sshfs via macports or by downloading and installing macfuse. (no links as I'm typing from my phone, though google should get it done for you)

share|improve this answer
Yeah, I know about that. But there’s the drawback that I’ll only be able to use local tools then. That’s equally bad as I will need access to remote tools as well. But +1 as it’s a good idea for others. – Debilski Jan 28 '10 at 13:57
Well, you could always have multiple windows open, one ssh'ed into the remote machine, one browsing files via sshfs. If you want to use local tools, use the sshfs browser, remote tool the ssh console. You will be stuck to two separate interfaces: one for local editing, one for remote. There's no magic escape that merges both into one (which is what you originally asked, I see now). – SuperMagic Jan 28 '10 at 14:23
you'd need multiple windows anyway; you can't do what you want over a single connection. (well... not without using "ssh -c 'remote-cmd user@host`" every time you wanted to run a remote command.) – quack quixote Jan 28 '10 at 16:37
Too bad. There should really be an ssh escape command which grabs the current working directory in a remote shell and executes a user defined command with that information one the local shell. – Debilski Jan 28 '10 at 23:19

Deleted as @SCARFACE's answer is far better. BBEdit on the Mac apparently support some nifty remote editing , though. I've never used it.

Here's a link that demonstrating BBEdit editing a remote file

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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