scp -i myAmazonKey.pem folder.zip ec2-user@ip-adress:/location
Here is what the above code is Doing:
1. It’s creating a zip file of the folder you want to transfer.
2. It’s transferring the zip file to the remote server.
3. It’s unzipping the file on the remote server.
4. It’s deleting the zip file on the remote server.