Opening a .tar.gz file with a single command Opening a .tar.gz file with a single command linux linux

Opening a .tar.gz file with a single command


tar xzf file.tar.gz

The letters are:

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


You can use tar with a "z" argument

tar xvfz mytar.tar.gz


If you don't have gnu tar it is still possible to open the file in a single step (although technically still two commands) using a pipe

zcat file.tar.gz |tar x