Moving a file
I just finished writing some code on a school computer using ssh on my personal computer to access that computer. I now need to copy that file from the school's computer onto my computer or onto a flash drive. What is the best way to do this?
I have read that using SFTP to connect to the school's computer would work better than ssh for transferring a file. So my question is, once I have connected to the computer through SFTP, how can I transfer the file over? I am doing all of this in Ubuntu at the terminal window, is there a simple command that I can type to transfer a file from the school's computer to mine?
I figured it out. I used sftp to connect to the linux computer then used get filename to copy the file onto my computer.
well done. in the future, you can do it even quicker with scp - which is non-interactive (think of it like remote "cp").
Originally Posted by ARosch
here's an example, run it from your local Ubuntu PC:
that will copy the file "file.txt" in the remote directory "/path/to/" on the school pc to your home directory (~). so you'd find the file in ~/file.txt (which expands to something like /home/username/file.txt) on your Ubuntu pc.
scp username@school_pc:/path/to/file.txt ~
You can replace the ~ in the command with any local directory, or even a new filename, if you wish.