Take the 2-minute tour ×

I'm currently trying to get a file on my school account from home on my mac using SSH. I have the hostname and I can get in just fine, but transferring files is like smashing my head into a wall over and over again. It appears I need to use scp. From Website One and WebsiteTwo. So far, in SSH in my terminal I have such;

~/assign$1 scp Username@Hostname:/home/burj1620/assign/a3.submit /Users/me/Development/Assignments1620/Assignment3

However I get the following error;

/Users/me/Development/Assignments1620/Assignment3: No such file or directory

After checking my spelling over and over again I tried just using /Desktop as the second location. This, however, just copied the a3.submit file from it's current directory to the desktop, not to my computer at home. Is there something obvious I'm missing? It seems rather easy but it just doesn't work.


share|improve this question
Does the Assignment3 directory already exist? scp won't make it for you if it does not exist. Actually, I'm confused about your second comment that says "to the desktop, not to my computer at home". Which desktop? You might want to clarify which direction you want to transfer the file, which is your home machine, which is the remote machine, and which one you're typing commands into. –  Greg Hewgill Oct 3 '12 at 1:31
add comment

migrated from stackoverflow.com Oct 3 '12 at 20:18

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

1 Answer

up vote 1 down vote accepted

You need to run scp on your computer at home.

So basically the concept is as follows:

scp <user>@<remote_host>:/path/to/file/on/remote/computer /local/path/on/your/computer/file

If you're executing that command AFTER you logged in to the remote machine via SSH and you use remote machine in your command as remote_host, effectively you're just copying it around on the same box.

Also, on your mac, you can use Tab key, to complete path names. Just type a few starting letters and hit Tab key. Will save you checking for spelling. Completion will stop when multiple alternatives are found, double-Tab will show you alternatives, add enough letters to the word to make it unique and press Tab again.

share|improve this answer
Thank you, no more head smashing. –  user1209379 Oct 3 '12 at 1:43
add comment

Your Answer

