Opening a .tar.gz file with a single command

前端 未结 7 1320
时光取名叫无心
时光取名叫无心 2021-01-31 15:13

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?

7条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 15:51

    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
    

提交回复
热议问题