I was wondering what the difference is when decompressing using
gzip -d and
Sometimes when I try
gzip -d it says unknown suffix -- ignored. However,
zcat works perfectly.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
zcat equivalent using
gzip -dc, and when used that way, it doesn’t care about the file extension. Both variants decompress their input and output the result to their standard output.
gzip -d on the other hand is intended to decompress a file, storing the uncompressed contents in another file. The output file’s name is calculated from the input’s, by removing its extension; files whose extension doesn’t match one of those handled by
gzip are ignored. The documentation says that
gunziptakes a list of files on its command line and replaces each file whose name ends with .gz, -gz, .z, -z, or _z (ignoring case) and which begins with the correct magic number with an uncompressed file without the original extension.
gunzipalso recognizes the special extensions .tgz and .taz as shorthands for .tar.gz and .tar.Z respectively.
Files with no extension, or any other extension, are ignored, producing the message you see:
unknown suffix — ignored