sftp copy files from windows server to linux server using shell scripting <p>I am working on shell script that is supposed to transfer files (with their subdirectories) from a Windows Server to a Linux-Samba server. The Windows server is setup to accept sftp requests and I am logging into the Windows server with shared ssh keys so there is no need for a password exchange. I can log into the Windows from the linux server with this command:</p> <pre><code> sftp user@host_name </code></pre> <p>It executes the sftp command and logs me into the Windows server. When I try to use the:</p> <pre><code> get -r /home_directory/first_level/* /local/directory/to/put/files </code></pre> <p>I get an error message saying "Invalid flag -r". I can't use SCP because it is not enabled on the server. </p> <p>What can I do in order to recursively copy all the files and directories from the Windows server to the linux server using a shell script?</p>