"put -r" in sftp fails with "Invalid flag"

I'm using Linux server and want to transfer some directories into another server which has Solaris as OS. when I'm connection to server using sftp and transferring it is showing error:

sftp> lpwd
Local working directory: /home/test
sftp> ls
test
sftp> put -r test/
Invalid flag -r

I want to transfer directory and sub-directories all using sftp. How to do that?

2 Answers

There's no -r flag in OpenSSH sftp put command.

An upload in this client is always recursive.

So use just:

put test/

Or

put test/ /target/directory/

To put the files recursively you need to have the directory test created. So use

mkdir test

and then

put test/

of you can use scp which have such flag

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like