how to copy file from ec2 instance to local machine code example
Example 1: send file to aws ec2 termnal
// To copy one file
scp -i path/to/key file/to/copy user-xx-xx-xxx-xxx.compute-1.amazonaws.com:path/to/file
// To copy an entire directory
scp -i path/to/key -r directory/to/copy user-xx-xx-xxx-xxx.compute-1.amazonaws.com:path/to/directory
Example 2: upload zip file to ec2
$scp -i ~/Desktop/amazon.pem ~/Desktop/MS115.fa ubuntu-54-166-128-20.compute-1.amazonaws.com:~/data/