I have lots of tar(.tar.bz2) files containing multiple file types in a recursive directory. I want to extract just one type of file(let's say .txt files) from all the directories. How do i do that? I have this command to extract all the files in each directory:
for file in *.tar.bz2; do tar -jxf "${file}"; done
I want to extract only the ".txt" files instead of all.