LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   scp directories ? (https://www.linuxquestions.org/questions/linux-newbie-8/scp-directories-240734/)

the_rhino 10-09-2004 06:14 PM

scp directories ?
 
Can directories and the contents in them including sub-directories be copied with scp ? or, Do I need to make the directory and then use scp?

I would just use ftp but my experience with doing ftp from a linux box is painfully slow and scp is lightening fast.

Thanks

Tinkster 10-09-2004 06:21 PM

man scp
/-r


Cheers,
Tink

the_rhino 10-09-2004 06:43 PM

Thanks for responding.

I have read man scp several times and had a difficult time figuring out the syntax before I was able to just copy one file or a lot of them with -r

I tried your /-r and it does not work.

-r copies the contents. I want to know if the directory *and* the contents can be copied in the same command step.

You either missed what I was asking or I do not understand your answer. :confused:

trickykid 10-09-2004 07:23 PM

Say I wanted to copy directory called XYZ in my home directory from host A to my other host B and place in my home directory.

Example:

cd ~
scp -r XYZ/ username@hostB:/home/username/

Its that simple.

the_rhino 10-09-2004 07:44 PM

Thanks, I figured it out just before getting your post.

Tinkster 10-09-2004 08:11 PM

Quote:

Originally posted by the_rhino
I tried your /-r and it does not work.
Which program did you try it with?
try in
man scp


Cheers,
Tink

Shumakriss 09-28-2012 11:42 AM

Summary
 
To summarize the solution:

Copy directories remotely with SCP in this way

Code:

scp -r user1@ip:source_directory user2@ip:destination_directory
This will copy the folder 'destination_directory' INTO the folder 'source_directory'

To clarify the previous posts:

Code:

man scp
shows you the manual page for scp. while reading a man page, typing '/' followed by text will search (ie '/-r' searches for the -r option in the man page)

the_rhino 09-28-2012 11:52 AM

I asked that question 10-9-2004

ted_chou12 09-28-2012 11:55 AM

no wonder it has 20000+ views.

dominion7 10-03-2012 12:56 PM

Hmmm..
 
I have always just cd to the dir I want to put the data in, then
ran scp -r username@servername:/sourcedir/data data

the_rhino 10-03-2012 01:04 PM

Quote:

Originally Posted by dominion7 (Post 4796247)
I have always just cd to the dir I want to put the data in, then
ran scp -r username@servername:/sourcedir/data data

What is up with the sudden interest in my question from 8 years ago?

dominion7 10-03-2012 01:12 PM

HAHAHAHA.... I was in the middle of migrating a bunch of junk and was asked what I used. We came across this post at looking at others alternatives... pretty funny though..

suicidaleggroll 10-03-2012 02:51 PM

Quote:

Originally Posted by Shumakriss (Post 4791718)
To summarize the solution:

Copy directories remotely with SCP in this way

Code:

scp -r user1@ip:source_directory user2@ip:destination_directory
This will copy the folder 'destination_directory' INTO the folder 'source_directory'

Why bump an 8 year old post that has been clearly solved with information that isn't even correct?


All times are GMT -5. The time now is 09:54 PM.