I have a '.tar' file that contains multiple '.tar.gz' files. Within each of these '.tar.gz' there is a '.faa' file that I need. I don't want to unpack everything else.
I have been searching through a lot of old questions here but I seem to be getting stuck on one part of my code. Based on what I've read I wrote this:
tar -zxOf /pathtofolder/folder1.tar ".tar.gz" | tar -zxvf - '.faa'
However, it is only pulling from just one of the '.tar.gz' and not the other 6:
I then tried a for loop in case that was it:
tar -zxOf /Users/gchaput/Desktop/TestFolder/img_data_29800-13.tar | for file in '*.tar.gz'; do tar -zxf "$file" '*.faa'; done
But I get the error:
tar: Error opening archive: Failed to open '*.tar.gz'
I have a macOS 10.14.1 and so wildcard is not an option for me unfortunately.