Opening a .tar.gz file with a single command

前端 未结 7 1334
时光取名叫无心
时光取名叫无心 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:37

    Untar Single file from tar File compressed file

    To extract a single file called video.mpeg from video.tar use the following command as given below example.

    # tar -xvf video.tar video.mpeg
    

    video.mpeg

    Extracting Single file from tar.gz File

    Use the following command to extract a single file codefile.xml from websitecode.tar.gz archive file

    # tar -zxvf websitecode.tar.gz code.xml
    

    code.xml

    Extracting Single file from tar.bz2 File

    Use the command to extract single file file.html from websitecode.tar.bz2

    # tar -jxvfwebsitecode.tar.bz2 home/website/file.html
    

    /home/website/file.html

    Also you can read more about all the tar commands at This link explains all the useful tar commands available in linux

提交回复
热议问题