I am on centos server (via SSH) and I don't want to open file manager to copy dump file. What comand whould I use (scp or what) to copy that file from remote server directly to my comp.


cp ssh://user@server/app/dump.dat /home/


even more interested in how to copy file from my ssh session while I am on server back to my PC (of course I can logout or open new terminal tab or start up SSH server on PC)

4 Answers 4

scp your_username@remotehost.edu:foobar.txt /some/local/directory

This Reference may help.

  • and how to use scp vice versa when I am on my remote server?
    – fl00r
    Mar 23, 2011 at 15:50
  • @fl00r: Start the SSH server on your PC, then use scp
    – user1686
    Mar 23, 2011 at 15:54
  • as I thought :) But I don't want to start ssh server. thx
    – fl00r
    Mar 23, 2011 at 15:55
  • If you're behind a firewall or behind NAT the only way without setting up port forwarding is to use a 'client pull' system (scp run locally) or to tunnel something back down through the SSH channel with SSH's port tunneling. What you'd use for that is anyone's guess, but you'd need to start some form of server on your local machine - be it sshd, ftpd, or whatever.
    – Majenko
    Mar 23, 2011 at 16:02
  • unless the terminal you are using supports something like zmodem then you could use sz to send the file as if you were on a slow serial connection... smirk
    – Majenko
    Mar 23, 2011 at 16:03
$ scp user@server:/app/dump.dat /home/

For a path relative to your home dir miss out the first /

Take a look at the scp man page for more detail.


rsync is generally a better option. It is restartable, for one thing. Also, it is generally faster. See man rsync for tons of options.

rsync -abvz your_username@remotehost.edu:foobar.txt /some/local/directory

rsync is probably configured to use ssh by default, but if you want to be extra careful you can do

rsync -abvz -e ssh your_username@remotehost.edu:foobar.txt /some/local/directory


sudo -r scp file username@IP address or hostname:Destination


scp -r /media/disk/summer_pics/ mike@"/var/www/Summer 2008/"


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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