On Linux, we generally use the head/tail commands to preview the contents of a file. It helps in viewing a part of the file (to inspect the format for instance), rather than ope
One easy way to do is :-
aws s3api get-object --bucket bucket_name --key path/to/file.txt --range bytes=0-10000 /path/to/local/t3.txt | cat t3 | head -100
For the gz file , you can do
aws s3api get-object --bucket bucket_name --key path/to/file.gz --range bytes=0-10000 /path/to/local/t3 | zless t3 | head -100
If the data is being less, incerease the amount of bytes required