10 SCP Commands to Transfer Files/Folders in Linux

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Pungki Arianto

Currently I am a Linux/Unix administrator. But I also play Windows both in server and desktop area. Interested in information technology, information security and writing.

TecMint users Get a Free Domain and 30% off on Inmotion Web Hosting - Signup with Inmotion Now!

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

30 Responses

  1. Andrés says:

    Hi, thanks for sharing. One question: I try copy a folder in Linux to Windows… by command line in Linux. Exactly through .sh file (Is a automatic backup). Both PC are in same LAN. This is my instruccion:

    scp /srv/zimbra_mail/ admin@

    But it doesn’t work. ¿Can you help me? Thanks

    • Ravi Saive says:

      You can’t just scp from Linux to Windows..it would not work..to use scp both machines must be Linux..

    • Namick says:

      SCP is part of SSH protocol. If you are copying between two machines then both needs to support SSH.

      So if you need to copy from linux(by default ssh is included) to windows you will have to install SSH server on windows PC.

      Any machine can support scp to any machine just note that both must have ssh server installed.


  2. danang says:

    How to send file from selected file (ls command) ?

    • Pungki Arianto says:

      I am not really understanding what you meant.

      If you can get the filename from ls command, then you can put the file name after the scp command.

      Example : $ scp file_name destination

  3. Mr Genki says:

    I SSHed into my iphone, and attempted to copy a file onto localhost. When asked for a password, i entered my password i use to log into the localhost, however i get a password incorrect error. any suggestions?

  4. Guilherme says:

    I also want to let you know how this was helpful for me!

  5. Hi,

    I just want to say you All guys for sharing helpful information . Please keep it up so we can learn a lot :) :)

  6. Tony Keller says:

    What is the path syntax for copying a file from a Linux box to a Windows box? I will have a key so my command would like:

    scp $FILE_HOME/${CSV1} svc_usercopy@$job_server:”D:\Kronos Master File Directory\Employees\Employees Import.csv”

    I don’t know if the Linux server cares what the Windows directory looks like or not. Any ideas on how this should look?

  7. Excellent write up. Very helpful. Thank you! But the local user directory on Mac OS X wasn’t being recognized for me. It kept throwing me a ‘no such directory’ error. I could only get it to find a folder in my root directory, but the transfer broke off and nothing was actually copied, possilby due to permissions accessing a root directory, for which I needed a password just to create a new folder. Any suggestions?

    My command was as follows, for copying remote to local: scp -prC root@lvps178-77-101-202:/var/www/vhosts ~/Downloads/ppcom-backup

  8. Will says:

    Incredibly useful stuff. Thank so much for publishing. -C is a life saver!

  9. Adán says:

    This is a terrific post! It helped me to backup all of my data from my previous computer to my new one. The “scp -r” and you just saved me a lot of money! Haha

    Thank you so much and keep going on sharing all of this helpful stuff to all the Linux community.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Join Over 62000+ Linux Users
  1. 47558
  2. 2150
  3. 11343

Enter your email to get latest Linux Howto's