How to upload files to amazon ec2 instance | copying from local to aws

Upload: 

Transferring Files Local to Amazon instance:

$scp -i ~/Download/amazon.pem ~/Desktop/hello.txt  ubuntu@ec2-54-166-128-20.compute-1.amazonaws.com:~/data/

To transfer zip or tar or directory:

$scp  -r -i ~/Download/amazon.pem ~/Desktop/hello.txt ubuntu@ec2-54-166-128-20.compute-1.amazonaws.com:~/data/

Download:

To download a file from Amazon instance to local:

$scp -i ~/Download/amazon.pem ubuntu@ec2-54-166-128-20.compute-1.amazonaws.com:/data/ecoli_ref-5m-trim.fastq.gz ~/Download/

To Download zip or tar or directory:

$scp -r -i ~/Download/amazon.pem ubuntu@ec2-54-166-128-20.compute-1.amazonaws.com:/data/ecoli_ref-5m-trim.fastq.gz ~/Download/