Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th September 2008, 05:23
dealspiggy dealspiggy is offline
Member
 
Join Date: Mar 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to copy a folder via SSH on CentOS 5?

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
Reply With Quote
Sponsored Links
  #2  
Old 7th September 2008, 12:35
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

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/
Reply With Quote
  #3  
Old 7th September 2008, 16:17
dealspiggy dealspiggy is offline
Member
 
Join Date: Mar 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry about the confusion. But I want to copy a folder to somewhere on the same server. Can I use scp?
Reply With Quote
  #4  
Old 8th September 2008, 10:09
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
 
Default

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/

?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos 5.x/ZM 1.23.1 Setup Guide oakleeman Suggest HOWTO 1 18th February 2008 13:49
centos kernel update with raid controller (kernel panic) blunt Kernel Questions 12 12th November 2007 15:28
Centos 5 Perfect Install with SSH tal56 Installation/Configuration 3 31st October 2007 05:23
Rename folder -> create new folder equals contents of old folder BlueStream General 20 15th December 2006 03:32
SSH port forwarding (SQLYog Tunnel) mastorna Server Operation 0 22nd June 2006 01:16


All times are GMT +2. The time now is 01:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.