Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible in SSH terminal to copy a folder directory into another directory that will share mostly the same folder names/structure but will have unique files.

In a simple example:

If FOLDER1 has APP > CODE > COM > FILE 1

And FOLDER2 has APP > CODE > COM > FILE 2 THEME > BAH > FILE 3

Is it possible to copy app across 'app' to 'app' so that the files will populate the existing folders and new folders that aren't present will be created in the same structure.

Basically I'm trying to install a module that I would normally do through FTP but I only have SSH access to this new server.

Using scp results in ./app: Directory not empty

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

you should try rsync

it is a tool commonly used for backups, so it is able to do just what you want

I think

rsync -avz /some/dir/ user@machine:/some/other/dir

should fit your bill perfectly

share|improve this answer
add comment

You can use scp to upload your files to the remote machine into a separate directory, then ssh into the machine and just use cp command to copy the files from one directory to another, with something like.

cp -R /path/to/FOLDER1/* /path/to/FOLDER2
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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