How to extract content from compressed files on Linux
The easiest way to extract the content of compressed files (and compressed archives) on Linux is to prepare a script that both recognizes files by type and uses the proper commands for extracting their contents. Almost every compressed file will have an easily recognizable file extension — .Z, .gz, .tgz etc. And while the commands aren’t very complex, there sure are a lot of them and many options for each.
So, why not attack the problem with a script that saves your precious brain cells for more challenging work? Let's look at an example that you might want to consider.