1

I have an SFTP server with the following directories:

dir1
test_results
templates

How can I get everything inside these directories as is to my local?

I tried:

get -r dir1 test_results templates

But it is considering the test_results as a directory in side the local machine and put the dir1 inside it.

Can someone help me?

1 Answers1

4

Just issue separate get command for each directory.

get -R dir1
get -R test_results
get -R templates

The OpenSSH sftp get command accepts one mandatory source remote-path parameter and one optional target local-path parameter. Nothing more.

For recursive download, the official switch is -R (-r is just an undocumented alias).