How to distribute compressed files as text?

Hello everybody,

I've seen some text documents where they publish blocks of text and tell you to save it as "file.tgz" for example, and when you decompress the file, it actually works.

How is that done? is there a program?
Because i tried cat and doesn't work, tried less, more, hexedit and nothing...

Thank you!

You can use tar zcvf to produce a tgz file, a gzipped tar file. You can then use uuencode to encode that tgz file into text.

Subsequently you can use uudecode to turn it back into a .tgz file and then use tar zxvf to get the original content back.

Thank you very much Scrutinizer,
That's exactly what i was looking for.