You can copy the latest object in S3 with the following commands
KEY=`aws s3 ls $BUCKET --recursive | sort | tail -n 1 | awk '{print $4}'`\\
$ aws s3 cp s3://$BUCKET/$KEY./latest-object
This is what these commands do.
Download first all objects in the bucket by running
.aws s3 ls $BUCKET --recursive
Sort next the objects chronologically by running
The sorted output will put the most recently uploaded object at the end.
Command downloading the last uploaded file it should be
$ aws s3 ls $BUCKET --recursive | sort | tail -n 1 | awk '{print $4}'
tail -n 1 prints last line awk '{print $4}' prints the name of the object.
Now use the above obtained object name with "aws s3 cp" command for downloading the requested object.
$ aws s3 cp s3://$BUCKET/$KEY./latest-ob