Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So I SSH into a Ubuntu server and try to open the file in a Mac program (Coda) and get an error:

Couldn't get a file descriptor referring to the console

Using the command

open myfile.html

This works in a Mac terminal. I hope there are common Unix commands that provide a way to bridge this so I can open directly and edit/save in the editor of my choice on the Mac.

share|improve this question
add comment

migrated from stackoverflow.com Apr 4 '12 at 18:42

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 2 down vote accepted

open is an OS X command. When SSHing you are running commands on Ubuntu, not OS X.

You want to open a file locally? I believe Coda has SFTP support built in (so you could eschew the terminal entirely). Failing that, scp the file to your local system and open locally.

share|improve this answer
    
yes looks like I can only sftp in via code, which was wha tI was doing. –  welovedesign Apr 4 '12 at 9:25
add comment

The open command on Linux is unrelated; it is (on most distributions) another name for openvt, which starts a program in a new text console (a feature that isn't used much nowadays).

The command corresponding to OSX's open, on a modern Linux system, is xdg-open. However, that would open the file in a program running on the remote Linux machine, not locally on the Mac.

SSH provides a way to run remote commands from a remote prompt. It doesn't directly provide a way to access remote files. Most unices, including OSX, allow a remote directory to be mounted over SSHFS. You can create a directory on the Mac, say ~/ubuntuserver, and make the remote files accessible under this directory:

sshfs ubuntuserver.example.com: ~/ubuntuserver

There may be a Mac GUI for that (I wouldn't know).

To avoid authentication hassles, it is recommended to use a public key for authentication, and if your SSH is recent enough to support it, to activate master/slave connections in ~/.ssh/config.

share|improve this answer
add comment

Typically on a Linux shell you would use cat, more, or view to view a text file. But since you are looking at html you could also use links to see a nicer view of it. These are are "terminal applications", that work in a text interface.

share|improve this answer
add comment

Your Answer

 
discard

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