up vote 1 down vote favorite
share [g+] share [fb]

I've got a bad backup script including an unwanted file. The .tar.gz backup file is 5gig big and I'd like to get a list of every file in the archive and their size.

Is that possible ? How would you do it ?

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

This should list all files and detailed information about them:

tar -ztvf somefile.tar.gz
link|improve this answer
feedback

Use

tar --list --verbose --gunzip --file backup.tar.gz > backup_list.txt

to create a file containing a list of all the files in your archive.

You can then grep foo backup_list.txt to find things, or edit, sed, cut, view, etc.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.