What is a nice command-line trick to tell if a
.gz file is really gzipped, as opposed to being a non-Gzip file just named that way?
You can use the
file command to do this. It will look at the magic numbers in the file and tell you what type it really is.
If it is gzip'd the first two bytes are 0x1F and 0x8B.
To get more complicated than that you will need to understand the file format. See here: http://www.gzip.org/zlib/rfc-gzip.html and go down to "Member header and trailer" section where you can identify a gzip by its 10 byte header.