Recursively scp except current directory
cd dir1scp -r . remote:/newfolder
This avoids giving scp
a chance to do anything with the name dir1
on the remote machine. You might also prefer:
(cd dir1; scp -r . remote:/newfolder)
This leaves your shell in its original directory, while working the same (because it launches a sub-shell that does the cd
and scp
operations).