Show tar.gz files but tar.gz is already inside a tar file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I want to see a tar.gz files that are inside a tar file.



So I have a tar file that has a tar.gz file inside and I want to see the tar.gz files without extraction my tar and my tar.gz.



So to explain more, inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see the files inside my tar.gz but my tar.gz is already inside my tar, and that without extracting my tar and also my tar.gz.



I tried this but doesn't work :
tar -xvf File.tar File2.tar.gz | gtar -ztvf -



Can you help me with this?










share|improve this question























  • Hello again , inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see file inside my tar and inside my tar.gz that is already inside my tar .
    – Issam
    Jan 3 '17 at 11:00











  • It might help to use example filenames. As it stands, your explanation is not the clearest.
    – Faheem Mitha
    Jan 3 '17 at 11:17










  • I have this file . File.tar inside this file you can find a file.tar.gz and other files , when I do a tar -tvf File.tar , I can see all the files : exemple : File1 and File2.tar.gz but I want to see the files inside File2.tar.gz . I know I can do something like tar -xvf File.tar -O File2.tar.gz.
    – Issam
    Jan 3 '17 at 11:23










  • Or something like that
    – Issam
    Jan 3 '17 at 11:24










  • Or I need to make a pipe or an exec.
    – Issam
    Jan 3 '17 at 11:25














up vote
2
down vote

favorite












I want to see a tar.gz files that are inside a tar file.



So I have a tar file that has a tar.gz file inside and I want to see the tar.gz files without extraction my tar and my tar.gz.



So to explain more, inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see the files inside my tar.gz but my tar.gz is already inside my tar, and that without extracting my tar and also my tar.gz.



I tried this but doesn't work :
tar -xvf File.tar File2.tar.gz | gtar -ztvf -



Can you help me with this?










share|improve this question























  • Hello again , inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see file inside my tar and inside my tar.gz that is already inside my tar .
    – Issam
    Jan 3 '17 at 11:00











  • It might help to use example filenames. As it stands, your explanation is not the clearest.
    – Faheem Mitha
    Jan 3 '17 at 11:17










  • I have this file . File.tar inside this file you can find a file.tar.gz and other files , when I do a tar -tvf File.tar , I can see all the files : exemple : File1 and File2.tar.gz but I want to see the files inside File2.tar.gz . I know I can do something like tar -xvf File.tar -O File2.tar.gz.
    – Issam
    Jan 3 '17 at 11:23










  • Or something like that
    – Issam
    Jan 3 '17 at 11:24










  • Or I need to make a pipe or an exec.
    – Issam
    Jan 3 '17 at 11:25












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I want to see a tar.gz files that are inside a tar file.



So I have a tar file that has a tar.gz file inside and I want to see the tar.gz files without extraction my tar and my tar.gz.



So to explain more, inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see the files inside my tar.gz but my tar.gz is already inside my tar, and that without extracting my tar and also my tar.gz.



I tried this but doesn't work :
tar -xvf File.tar File2.tar.gz | gtar -ztvf -



Can you help me with this?










share|improve this question















I want to see a tar.gz files that are inside a tar file.



So I have a tar file that has a tar.gz file inside and I want to see the tar.gz files without extraction my tar and my tar.gz.



So to explain more, inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see the files inside my tar.gz but my tar.gz is already inside my tar, and that without extracting my tar and also my tar.gz.



I tried this but doesn't work :
tar -xvf File.tar File2.tar.gz | gtar -ztvf -



Can you help me with this?







tar aix gzip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 29 at 6:41









Jesse Steele

12717




12717










asked Jan 3 '17 at 10:52









Issam

434




434











  • Hello again , inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see file inside my tar and inside my tar.gz that is already inside my tar .
    – Issam
    Jan 3 '17 at 11:00











  • It might help to use example filenames. As it stands, your explanation is not the clearest.
    – Faheem Mitha
    Jan 3 '17 at 11:17










  • I have this file . File.tar inside this file you can find a file.tar.gz and other files , when I do a tar -tvf File.tar , I can see all the files : exemple : File1 and File2.tar.gz but I want to see the files inside File2.tar.gz . I know I can do something like tar -xvf File.tar -O File2.tar.gz.
    – Issam
    Jan 3 '17 at 11:23










  • Or something like that
    – Issam
    Jan 3 '17 at 11:24










  • Or I need to make a pipe or an exec.
    – Issam
    Jan 3 '17 at 11:25
















  • Hello again , inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see file inside my tar and inside my tar.gz that is already inside my tar .
    – Issam
    Jan 3 '17 at 11:00











  • It might help to use example filenames. As it stands, your explanation is not the clearest.
    – Faheem Mitha
    Jan 3 '17 at 11:17










  • I have this file . File.tar inside this file you can find a file.tar.gz and other files , when I do a tar -tvf File.tar , I can see all the files : exemple : File1 and File2.tar.gz but I want to see the files inside File2.tar.gz . I know I can do something like tar -xvf File.tar -O File2.tar.gz.
    – Issam
    Jan 3 '17 at 11:23










  • Or something like that
    – Issam
    Jan 3 '17 at 11:24










  • Or I need to make a pipe or an exec.
    – Issam
    Jan 3 '17 at 11:25















Hello again , inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see file inside my tar and inside my tar.gz that is already inside my tar .
– Issam
Jan 3 '17 at 11:00





Hello again , inside my tar I have a tar.gz, File.tar -> File.tar.gz. so I need to see file inside my tar and inside my tar.gz that is already inside my tar .
– Issam
Jan 3 '17 at 11:00













It might help to use example filenames. As it stands, your explanation is not the clearest.
– Faheem Mitha
Jan 3 '17 at 11:17




It might help to use example filenames. As it stands, your explanation is not the clearest.
– Faheem Mitha
Jan 3 '17 at 11:17












I have this file . File.tar inside this file you can find a file.tar.gz and other files , when I do a tar -tvf File.tar , I can see all the files : exemple : File1 and File2.tar.gz but I want to see the files inside File2.tar.gz . I know I can do something like tar -xvf File.tar -O File2.tar.gz.
– Issam
Jan 3 '17 at 11:23




I have this file . File.tar inside this file you can find a file.tar.gz and other files , when I do a tar -tvf File.tar , I can see all the files : exemple : File1 and File2.tar.gz but I want to see the files inside File2.tar.gz . I know I can do something like tar -xvf File.tar -O File2.tar.gz.
– Issam
Jan 3 '17 at 11:23












Or something like that
– Issam
Jan 3 '17 at 11:24




Or something like that
– Issam
Jan 3 '17 at 11:24












Or I need to make a pipe or an exec.
– Issam
Jan 3 '17 at 11:25




Or I need to make a pipe or an exec.
– Issam
Jan 3 '17 at 11:25










5 Answers
5






active

oldest

votes

















up vote
3
down vote













You'll need to run tar -tf /path/to/file.tar.gz, or tar -tzf /path/to/file.tar.gz.



As far as I've seen, you should avoid using -tf, and prefer -tzf: at least on BSD systems, forgetting the z gives:



tar: input compressed with gzip; use the -z option to decompress it



Following up on your comment, say you want to list the content of an archive inside an archive, ... Try this:



tar -zxOf /path/to/parent/archive.tar.gz path/to/packed/archive.tar.gz | tar -ztf -


With path/to/packed/archive.tar.gz, the path of your archive inside /path/to/parent/archive.tar.gz.






share|improve this answer






















  • Doesn't work : and my parent package archive is a tar only not a tar.gz.
    – Issam
    Jan 3 '17 at 14:55










  • Do you have an error showing? The parent archive being a tar file, you can remove the z option from the first tar.
    – SYN
    Jan 3 '17 at 19:01










  • The option -O usually switches to old tar archive versions. You do not seem to speak about tar but probably about gtar.
    – schily
    Nov 29 at 9:49

















up vote
2
down vote













There are many solutions
you can use the command



tar -tvf filename.tar.gz


You can also use vim



vim filename.tar.gz





share|improve this answer




















  • vi and it's clones do not support to edit binary files without destroying the content and a compressed tar archive is heavily binary.
    – schily
    Nov 29 at 9:50

















up vote
0
down vote













vim fnm.tar.gz or vim flnm.tgz
tar -tvzf fnm.tar.gz or tar -tvzf flnm.tgz



Both of these will help display the contents in the file. If you have a tar file inside of another tar file then thats a bit tricky.






share|improve this answer



























    up vote
    0
    down vote













    _ for 1 level of taring _



    a portable solution to uncompress 'on the fly' and then have tar display the content:



    gzip -dc - <file.tar.gz | tar tvf -


    this is the pendant of the compression on the fly:



    tar cf - files and dirs | gzip -c - >newcompressedtarfile.tar.gz


    (of course, with a recent (and usually GNU variant) tar you can just: tar tzvf file.tar ... but the way above is portable, and can be generalised to many other scenarios (find infos inside files without ungzipping them first, etc)



    _ for you case: list the content of a .tar.gz that is inside a .tar _



    You will probably need the GNU version of tar and use the --to-stdout (or Capital O, -O) optino to uncompress a file to stdout instead of creating it on disk:



    # let's say Archive.tar contains file.tar.gz, 
    {and you want the content of the latter without writing any files on disk

    tar -xOf archive.tar file.tar.gz | gzip -dc - | tar tvf -





    share|improve this answer






















    • I can't do something like this : <code> tar -xvf File.tar | gtar File2.tar.gz | tar -tvf - </code>?
      – Issam
      Jan 3 '17 at 12:04











    • I have this error : tar: illegal option -- O
      – Issam
      Jan 3 '17 at 15:33










    • The -O parameter is used only with tar.gz files not with a tar file.
      – Issam
      Jan 3 '17 at 16:31










    • @Issam : you specified Linux, so usually GNU tar, which should know -O (not for compressed files, that was the z option which I just edited out as the first tar file is not .gz).
      – Olivier Dulac
      Jan 3 '17 at 17:20










    • The -O work for my tar.gz but not for my tar maybe because I am in Aix
      – Issam
      Jan 3 '17 at 17:51

















    up vote
    0
    down vote













    Gnu tar has "--to-command'



    tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz --to-command='tar tvzf -'


    Anyway "-O" also works for you :



    tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz -O | tar tvzf -





    share|improve this answer




















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f334495%2fshow-tar-gz-files-but-tar-gz-is-already-inside-a-tar-file%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote













      You'll need to run tar -tf /path/to/file.tar.gz, or tar -tzf /path/to/file.tar.gz.



      As far as I've seen, you should avoid using -tf, and prefer -tzf: at least on BSD systems, forgetting the z gives:



      tar: input compressed with gzip; use the -z option to decompress it



      Following up on your comment, say you want to list the content of an archive inside an archive, ... Try this:



      tar -zxOf /path/to/parent/archive.tar.gz path/to/packed/archive.tar.gz | tar -ztf -


      With path/to/packed/archive.tar.gz, the path of your archive inside /path/to/parent/archive.tar.gz.






      share|improve this answer






















      • Doesn't work : and my parent package archive is a tar only not a tar.gz.
        – Issam
        Jan 3 '17 at 14:55










      • Do you have an error showing? The parent archive being a tar file, you can remove the z option from the first tar.
        – SYN
        Jan 3 '17 at 19:01










      • The option -O usually switches to old tar archive versions. You do not seem to speak about tar but probably about gtar.
        – schily
        Nov 29 at 9:49














      up vote
      3
      down vote













      You'll need to run tar -tf /path/to/file.tar.gz, or tar -tzf /path/to/file.tar.gz.



      As far as I've seen, you should avoid using -tf, and prefer -tzf: at least on BSD systems, forgetting the z gives:



      tar: input compressed with gzip; use the -z option to decompress it



      Following up on your comment, say you want to list the content of an archive inside an archive, ... Try this:



      tar -zxOf /path/to/parent/archive.tar.gz path/to/packed/archive.tar.gz | tar -ztf -


      With path/to/packed/archive.tar.gz, the path of your archive inside /path/to/parent/archive.tar.gz.






      share|improve this answer






















      • Doesn't work : and my parent package archive is a tar only not a tar.gz.
        – Issam
        Jan 3 '17 at 14:55










      • Do you have an error showing? The parent archive being a tar file, you can remove the z option from the first tar.
        – SYN
        Jan 3 '17 at 19:01










      • The option -O usually switches to old tar archive versions. You do not seem to speak about tar but probably about gtar.
        – schily
        Nov 29 at 9:49












      up vote
      3
      down vote










      up vote
      3
      down vote









      You'll need to run tar -tf /path/to/file.tar.gz, or tar -tzf /path/to/file.tar.gz.



      As far as I've seen, you should avoid using -tf, and prefer -tzf: at least on BSD systems, forgetting the z gives:



      tar: input compressed with gzip; use the -z option to decompress it



      Following up on your comment, say you want to list the content of an archive inside an archive, ... Try this:



      tar -zxOf /path/to/parent/archive.tar.gz path/to/packed/archive.tar.gz | tar -ztf -


      With path/to/packed/archive.tar.gz, the path of your archive inside /path/to/parent/archive.tar.gz.






      share|improve this answer














      You'll need to run tar -tf /path/to/file.tar.gz, or tar -tzf /path/to/file.tar.gz.



      As far as I've seen, you should avoid using -tf, and prefer -tzf: at least on BSD systems, forgetting the z gives:



      tar: input compressed with gzip; use the -z option to decompress it



      Following up on your comment, say you want to list the content of an archive inside an archive, ... Try this:



      tar -zxOf /path/to/parent/archive.tar.gz path/to/packed/archive.tar.gz | tar -ztf -


      With path/to/packed/archive.tar.gz, the path of your archive inside /path/to/parent/archive.tar.gz.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jan 3 '17 at 11:07

























      answered Jan 3 '17 at 10:57









      SYN

      1,844415




      1,844415











      • Doesn't work : and my parent package archive is a tar only not a tar.gz.
        – Issam
        Jan 3 '17 at 14:55










      • Do you have an error showing? The parent archive being a tar file, you can remove the z option from the first tar.
        – SYN
        Jan 3 '17 at 19:01










      • The option -O usually switches to old tar archive versions. You do not seem to speak about tar but probably about gtar.
        – schily
        Nov 29 at 9:49
















      • Doesn't work : and my parent package archive is a tar only not a tar.gz.
        – Issam
        Jan 3 '17 at 14:55










      • Do you have an error showing? The parent archive being a tar file, you can remove the z option from the first tar.
        – SYN
        Jan 3 '17 at 19:01










      • The option -O usually switches to old tar archive versions. You do not seem to speak about tar but probably about gtar.
        – schily
        Nov 29 at 9:49















      Doesn't work : and my parent package archive is a tar only not a tar.gz.
      – Issam
      Jan 3 '17 at 14:55




      Doesn't work : and my parent package archive is a tar only not a tar.gz.
      – Issam
      Jan 3 '17 at 14:55












      Do you have an error showing? The parent archive being a tar file, you can remove the z option from the first tar.
      – SYN
      Jan 3 '17 at 19:01




      Do you have an error showing? The parent archive being a tar file, you can remove the z option from the first tar.
      – SYN
      Jan 3 '17 at 19:01












      The option -O usually switches to old tar archive versions. You do not seem to speak about tar but probably about gtar.
      – schily
      Nov 29 at 9:49




      The option -O usually switches to old tar archive versions. You do not seem to speak about tar but probably about gtar.
      – schily
      Nov 29 at 9:49












      up vote
      2
      down vote













      There are many solutions
      you can use the command



      tar -tvf filename.tar.gz


      You can also use vim



      vim filename.tar.gz





      share|improve this answer




















      • vi and it's clones do not support to edit binary files without destroying the content and a compressed tar archive is heavily binary.
        – schily
        Nov 29 at 9:50














      up vote
      2
      down vote













      There are many solutions
      you can use the command



      tar -tvf filename.tar.gz


      You can also use vim



      vim filename.tar.gz





      share|improve this answer




















      • vi and it's clones do not support to edit binary files without destroying the content and a compressed tar archive is heavily binary.
        – schily
        Nov 29 at 9:50












      up vote
      2
      down vote










      up vote
      2
      down vote









      There are many solutions
      you can use the command



      tar -tvf filename.tar.gz


      You can also use vim



      vim filename.tar.gz





      share|improve this answer












      There are many solutions
      you can use the command



      tar -tvf filename.tar.gz


      You can also use vim



      vim filename.tar.gz






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jan 3 '17 at 10:58









      Dababi

      2,0961017




      2,0961017











      • vi and it's clones do not support to edit binary files without destroying the content and a compressed tar archive is heavily binary.
        – schily
        Nov 29 at 9:50
















      • vi and it's clones do not support to edit binary files without destroying the content and a compressed tar archive is heavily binary.
        – schily
        Nov 29 at 9:50















      vi and it's clones do not support to edit binary files without destroying the content and a compressed tar archive is heavily binary.
      – schily
      Nov 29 at 9:50




      vi and it's clones do not support to edit binary files without destroying the content and a compressed tar archive is heavily binary.
      – schily
      Nov 29 at 9:50










      up vote
      0
      down vote













      vim fnm.tar.gz or vim flnm.tgz
      tar -tvzf fnm.tar.gz or tar -tvzf flnm.tgz



      Both of these will help display the contents in the file. If you have a tar file inside of another tar file then thats a bit tricky.






      share|improve this answer
























        up vote
        0
        down vote













        vim fnm.tar.gz or vim flnm.tgz
        tar -tvzf fnm.tar.gz or tar -tvzf flnm.tgz



        Both of these will help display the contents in the file. If you have a tar file inside of another tar file then thats a bit tricky.






        share|improve this answer






















          up vote
          0
          down vote










          up vote
          0
          down vote









          vim fnm.tar.gz or vim flnm.tgz
          tar -tvzf fnm.tar.gz or tar -tvzf flnm.tgz



          Both of these will help display the contents in the file. If you have a tar file inside of another tar file then thats a bit tricky.






          share|improve this answer












          vim fnm.tar.gz or vim flnm.tgz
          tar -tvzf fnm.tar.gz or tar -tvzf flnm.tgz



          Both of these will help display the contents in the file. If you have a tar file inside of another tar file then thats a bit tricky.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 '17 at 14:49









          Doogle

          1113




          1113




















              up vote
              0
              down vote













              _ for 1 level of taring _



              a portable solution to uncompress 'on the fly' and then have tar display the content:



              gzip -dc - <file.tar.gz | tar tvf -


              this is the pendant of the compression on the fly:



              tar cf - files and dirs | gzip -c - >newcompressedtarfile.tar.gz


              (of course, with a recent (and usually GNU variant) tar you can just: tar tzvf file.tar ... but the way above is portable, and can be generalised to many other scenarios (find infos inside files without ungzipping them first, etc)



              _ for you case: list the content of a .tar.gz that is inside a .tar _



              You will probably need the GNU version of tar and use the --to-stdout (or Capital O, -O) optino to uncompress a file to stdout instead of creating it on disk:



              # let's say Archive.tar contains file.tar.gz, 
              {and you want the content of the latter without writing any files on disk

              tar -xOf archive.tar file.tar.gz | gzip -dc - | tar tvf -





              share|improve this answer






















              • I can't do something like this : <code> tar -xvf File.tar | gtar File2.tar.gz | tar -tvf - </code>?
                – Issam
                Jan 3 '17 at 12:04











              • I have this error : tar: illegal option -- O
                – Issam
                Jan 3 '17 at 15:33










              • The -O parameter is used only with tar.gz files not with a tar file.
                – Issam
                Jan 3 '17 at 16:31










              • @Issam : you specified Linux, so usually GNU tar, which should know -O (not for compressed files, that was the z option which I just edited out as the first tar file is not .gz).
                – Olivier Dulac
                Jan 3 '17 at 17:20










              • The -O work for my tar.gz but not for my tar maybe because I am in Aix
                – Issam
                Jan 3 '17 at 17:51














              up vote
              0
              down vote













              _ for 1 level of taring _



              a portable solution to uncompress 'on the fly' and then have tar display the content:



              gzip -dc - <file.tar.gz | tar tvf -


              this is the pendant of the compression on the fly:



              tar cf - files and dirs | gzip -c - >newcompressedtarfile.tar.gz


              (of course, with a recent (and usually GNU variant) tar you can just: tar tzvf file.tar ... but the way above is portable, and can be generalised to many other scenarios (find infos inside files without ungzipping them first, etc)



              _ for you case: list the content of a .tar.gz that is inside a .tar _



              You will probably need the GNU version of tar and use the --to-stdout (or Capital O, -O) optino to uncompress a file to stdout instead of creating it on disk:



              # let's say Archive.tar contains file.tar.gz, 
              {and you want the content of the latter without writing any files on disk

              tar -xOf archive.tar file.tar.gz | gzip -dc - | tar tvf -





              share|improve this answer






















              • I can't do something like this : <code> tar -xvf File.tar | gtar File2.tar.gz | tar -tvf - </code>?
                – Issam
                Jan 3 '17 at 12:04











              • I have this error : tar: illegal option -- O
                – Issam
                Jan 3 '17 at 15:33










              • The -O parameter is used only with tar.gz files not with a tar file.
                – Issam
                Jan 3 '17 at 16:31










              • @Issam : you specified Linux, so usually GNU tar, which should know -O (not for compressed files, that was the z option which I just edited out as the first tar file is not .gz).
                – Olivier Dulac
                Jan 3 '17 at 17:20










              • The -O work for my tar.gz but not for my tar maybe because I am in Aix
                – Issam
                Jan 3 '17 at 17:51












              up vote
              0
              down vote










              up vote
              0
              down vote









              _ for 1 level of taring _



              a portable solution to uncompress 'on the fly' and then have tar display the content:



              gzip -dc - <file.tar.gz | tar tvf -


              this is the pendant of the compression on the fly:



              tar cf - files and dirs | gzip -c - >newcompressedtarfile.tar.gz


              (of course, with a recent (and usually GNU variant) tar you can just: tar tzvf file.tar ... but the way above is portable, and can be generalised to many other scenarios (find infos inside files without ungzipping them first, etc)



              _ for you case: list the content of a .tar.gz that is inside a .tar _



              You will probably need the GNU version of tar and use the --to-stdout (or Capital O, -O) optino to uncompress a file to stdout instead of creating it on disk:



              # let's say Archive.tar contains file.tar.gz, 
              {and you want the content of the latter without writing any files on disk

              tar -xOf archive.tar file.tar.gz | gzip -dc - | tar tvf -





              share|improve this answer














              _ for 1 level of taring _



              a portable solution to uncompress 'on the fly' and then have tar display the content:



              gzip -dc - <file.tar.gz | tar tvf -


              this is the pendant of the compression on the fly:



              tar cf - files and dirs | gzip -c - >newcompressedtarfile.tar.gz


              (of course, with a recent (and usually GNU variant) tar you can just: tar tzvf file.tar ... but the way above is portable, and can be generalised to many other scenarios (find infos inside files without ungzipping them first, etc)



              _ for you case: list the content of a .tar.gz that is inside a .tar _



              You will probably need the GNU version of tar and use the --to-stdout (or Capital O, -O) optino to uncompress a file to stdout instead of creating it on disk:



              # let's say Archive.tar contains file.tar.gz, 
              {and you want the content of the latter without writing any files on disk

              tar -xOf archive.tar file.tar.gz | gzip -dc - | tar tvf -






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 3 '17 at 17:16

























              answered Jan 3 '17 at 11:51









              Olivier Dulac

              3,8051325




              3,8051325











              • I can't do something like this : <code> tar -xvf File.tar | gtar File2.tar.gz | tar -tvf - </code>?
                – Issam
                Jan 3 '17 at 12:04











              • I have this error : tar: illegal option -- O
                – Issam
                Jan 3 '17 at 15:33










              • The -O parameter is used only with tar.gz files not with a tar file.
                – Issam
                Jan 3 '17 at 16:31










              • @Issam : you specified Linux, so usually GNU tar, which should know -O (not for compressed files, that was the z option which I just edited out as the first tar file is not .gz).
                – Olivier Dulac
                Jan 3 '17 at 17:20










              • The -O work for my tar.gz but not for my tar maybe because I am in Aix
                – Issam
                Jan 3 '17 at 17:51
















              • I can't do something like this : <code> tar -xvf File.tar | gtar File2.tar.gz | tar -tvf - </code>?
                – Issam
                Jan 3 '17 at 12:04











              • I have this error : tar: illegal option -- O
                – Issam
                Jan 3 '17 at 15:33










              • The -O parameter is used only with tar.gz files not with a tar file.
                – Issam
                Jan 3 '17 at 16:31










              • @Issam : you specified Linux, so usually GNU tar, which should know -O (not for compressed files, that was the z option which I just edited out as the first tar file is not .gz).
                – Olivier Dulac
                Jan 3 '17 at 17:20










              • The -O work for my tar.gz but not for my tar maybe because I am in Aix
                – Issam
                Jan 3 '17 at 17:51















              I can't do something like this : <code> tar -xvf File.tar | gtar File2.tar.gz | tar -tvf - </code>?
              – Issam
              Jan 3 '17 at 12:04





              I can't do something like this : <code> tar -xvf File.tar | gtar File2.tar.gz | tar -tvf - </code>?
              – Issam
              Jan 3 '17 at 12:04













              I have this error : tar: illegal option -- O
              – Issam
              Jan 3 '17 at 15:33




              I have this error : tar: illegal option -- O
              – Issam
              Jan 3 '17 at 15:33












              The -O parameter is used only with tar.gz files not with a tar file.
              – Issam
              Jan 3 '17 at 16:31




              The -O parameter is used only with tar.gz files not with a tar file.
              – Issam
              Jan 3 '17 at 16:31












              @Issam : you specified Linux, so usually GNU tar, which should know -O (not for compressed files, that was the z option which I just edited out as the first tar file is not .gz).
              – Olivier Dulac
              Jan 3 '17 at 17:20




              @Issam : you specified Linux, so usually GNU tar, which should know -O (not for compressed files, that was the z option which I just edited out as the first tar file is not .gz).
              – Olivier Dulac
              Jan 3 '17 at 17:20












              The -O work for my tar.gz but not for my tar maybe because I am in Aix
              – Issam
              Jan 3 '17 at 17:51




              The -O work for my tar.gz but not for my tar maybe because I am in Aix
              – Issam
              Jan 3 '17 at 17:51










              up vote
              0
              down vote













              Gnu tar has "--to-command'



              tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz --to-command='tar tvzf -'


              Anyway "-O" also works for you :



              tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz -O | tar tvzf -





              share|improve this answer
























                up vote
                0
                down vote













                Gnu tar has "--to-command'



                tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz --to-command='tar tvzf -'


                Anyway "-O" also works for you :



                tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz -O | tar tvzf -





                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Gnu tar has "--to-command'



                  tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz --to-command='tar tvzf -'


                  Anyway "-O" also works for you :



                  tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz -O | tar tvzf -





                  share|improve this answer












                  Gnu tar has "--to-command'



                  tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz --to-command='tar tvzf -'


                  Anyway "-O" also works for you :



                  tar xzf tarfile1.tar.gz pathto/tarfile2.tar.gz -O | tar tvzf -






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 3 '17 at 17:32









                  Vouze

                  62037




                  62037



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f334495%2fshow-tar-gz-files-but-tar-gz-is-already-inside-a-tar-file%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown






                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?