You can use the following command to check if a file exists or not:
aws s3 ls s3://bucket/file_name.txt | wc -l
If this command returns nothing that means the file that you searched for does not exist.
Use the following command to copy a file if it does not exist:
aws s3 sync . s3://bucket/ --exclude '*' --include 'file_name.txt'
Learn more about AWS by going through AWS course and master this trending technology.