I have a situation where I want to extract a file from nested tar.gz. The structure of .tar.gz is as
- test.tar.gz
- data1
- data2
- data3
- test2.tar.gz
- data4
- data5
- test.log
- data5
- data4
- test2.tar.gz
- data3
- data2
- data1
I want to extract only test.log file from the test.tar.gz file. I have seen this post with which we can extract file of tar.gz but not in nested levels.
I am adding output of tar tfz data1.tar.gz The folder structure might be a bit different as entered the above structure manually.
data1/.
data1/META.json
data1/TEMP
data1/TEMP/temp-2
data1/TEMP/temp-2/1-chksum.txt
data1/TEMP/temp-2/1
data1/TEMP/temp-2/1/otherfiles
data1/TEMP/temp-2/1/otherfiles/2016_06_24.tar.gz
So the test.log file is present within a nested folder inside 2016_06_24.tar.gz
tar tfz test.tar.gz
because your "nested" picture doesn't make things too clear. Edit the question with the output.