Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save khairulhasanmd/9627668a73454fa2d7e8 to your computer and use it in GitHub Desktop.
Save khairulhasanmd/9627668a73454fa2d7e8 to your computer and use it in GitHub Desktop.
Use winscp to copy linux directory to windows.
# this script must run on linux
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server using a password
open sftp://user:[email protected]/ -hostkey="ssh-rsa 2048 33:33:33:73:88:33:30:53:ef:33:66:33:66:33:33:33"
# Download File
cd /home/user/Desktop/folderToCopy/
lcd D:\folder\folder\folder\
get *
# put
# Disconnect
close
# to copy local(windows) dir to linux
# put D:\folder\folder\folder\ /home/user/Desktop/folderToCopy/
# Disconnect
# close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment