I want to download files from a remote server to my local drive, and do it from the command line. I also want to be able to do this over SSH. How can I do this?
Note: the remote server is Ubuntu, the local is Mac OS X
04 Answers
Use scp-command, it runs on top of SSH. Example:
scp :/path/to/file localfileIt also works another way round
scp localfile username@host:/path/remotefileUsername, path, and filename can be omitted (but not the : !).
As Iain said, SFTP works also, but I tend to favor scp for its cp-like usage.
You can also use rsync for it. It can work over SSH.
I use SFTP for this. It's command line and uses the same security as SSH.
If you can't use scp or SFTP you can use tar over SSH:
tar cf - . | ssh otherhost "cd /mydir; tar xvf -"This one is also good if you have sparse files which otherwise will "explode".