0

Please confirm if .DAT extension files are the same as compressed format files (.zip ) in Unix. As I try to use gzip filename.DAT then is the original 2 GB file size the same after compression? Is there any alternative to reduce the size of .DAT extension files?

2
  • 2
    The filename does not mean anything on a Unix system. You can have a directory called my diary.doc. You could possibly identify the type of contents in a file by using the file utility, but simply looking at the filename suffix will most likely not be enough. Since it's your files, you ought to know where you get them from, right? And then also what they may contain, and therefore why they aren't compressible.
    – Kusalananda
    Commented Dec 16, 2022 at 9:23
  • 2GB is a rounded number. Are they exactly the same size? It is very unlikely that compression will result in the same number of bytes. A gzip adds some structure, so for previously compressed data it may grow a little, or shrink a little, but it will change whatever. The man page states "Compression is always performed, even if the compressed file is slightly larger than the original." Commented Dec 16, 2022 at 20:20

1 Answer 1

0

please confirm if .DAT extension files are same as compressed format files (.zip ) in Unix.

Can't confirm since your claim is wrong.

A file extension tells you nothing about the content of a file, and especially in your case your assumption just seems wrong.

As I try to use gzip filename.DAT then file size 2 GB is same after compression?

Some kind of data has low entropy in a way that gzip is able to compress, other data has not. Gzip, especially, is very old and not very good a compressor.

Is there any alternative to reduce size for .DAT extention files?

Maybe, a different compressor has better methods to deal with your specific data. There's very many, like LZMA/7z/Xz, or zstd.

It's not very likely you will get great compression if gzip could do nothing, though. Some data simply has high entropy, and even theoretically, you can't reduce the size of that.

5
  • Hello Marcus, Thanks for quick response. As I verified the filename.DAT contains unreadable format data and when we try to compress it using gzip so its no use please.... we have many more .DAT files with Gigabytes size and wants to reduce/compress this .DAT files. please correct me if any option.
    – kumar
    Commented Dec 16, 2022 at 15:51
  • I addressed all this. Please re-read my answer. Commented Dec 16, 2022 at 16:05
  • 1
    If the data is unreadable and in an unknown format, why do you want to keep it all ? When would it become useful ? Commented Dec 16, 2022 at 20:38
  • Hi Marcus/Paul, Thanks for your help much, I will try and will come back if any again.
    – kumar
    Commented Dec 17, 2022 at 0:55
  • I'm not sure whether you understand what Paul suggested you do to your files. 🤣 Commented Dec 17, 2022 at 7:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .