unzipping a .gz file On Linux and MacOS, a .gz file can be decompressed using the gzip command. For example: gzip -d log.gz The command above will replace the .gz file with the decompressed version, leaving you with log instead of log.gz.