I am trying to read the head of a gz file using awscli without downloading. I am using the command
aws s3api get-object --bucket mybucket_name --key path/to/the/file.log.gz --range bytes=0-10000 /dev/stdout | zless
which I found in the link https://stackoverflow.com/questions/25983769/head-command-for-aws-s3-to-view-file-contents?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
I am able to read head of simple txt files, but how to do it for .gz files. Or any other way using some other tool if it can be accomplished?