Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List the contents of multiple .tar archive files

To list the content of one .tar archive file I use

tar -tvf archive.tar

and I was hoping to use similar format to list the contents from more files, but

tar -tvf *.tar

is not working as I expected.

What is the best one line solution to list the contents of multiple .tar archive files?

like image 551
Ωmega Avatar asked Dec 25 '22 19:12

Ωmega


1 Answers

does this help?

for f in *.tar 
do 
    echo "content of $f:"
    tar tvf "$f"
done
like image 94
Kent Avatar answered Jan 06 '23 01:01

Kent