how to copy a folder via SSH on CentOS 5?

Discussion in 'HOWTO-Related Questions' started by dealspiggy, Sep 7, 2008.

  1. dealspiggy

    dealspiggy New Member

    I'm trying to copy an entire folder to another location by using 'cp' command, but it keeps giving me an error.

    I wonder how to copy a folder via SSH? thanks
  2. Ben

    Ben HowtoForge Supporter

    what do you mean by another location - another server?
    Then use scp.
    For the normal copy you need -R for recursive.

    to copy across servers look in the manpages for the usage of scp:

    scp ./pathtolocalfolderorfile/ user@yourserver:/deistinationpath/
  3. dealspiggy

    dealspiggy New Member

    sorry about the confusion. But I want to copy a folder to somewhere on the same server. Can I use scp?
  4. Ben

    Ben HowtoForge Supporter

    Than scp makes no sense if it's one the same server as it's the "same" as cp just based on ssh to transfer across servers.

    So what does not work with
    cp -r /copy/thissourcedir /intothisdestinationfolder/


Share This Page