Opening a .tar.gz file with a single command

flybywire picture flybywire · Mar 16, 2009 · Viewed 57.7k times · Source

When I download a .tar.gz file, I open it with two commands, first gunzip and then tar.

Is it possible to open it with just one command?

Answer

unwind picture unwind · Mar 16, 2009
tar xzf file.tar.gz

The letters are:

  • x - extract
  • z - gunzip the input
  • f - Read from a file, not stdin