List Tar Contents - 06-13-21

Before putting a tar file somewhere hard to access like S3 Glacier I note what is in it. I create a manifest file. Simply list the file names within:

$ tar tvf example.tar

With more automation worked in I came up with this:

  • list all the tar files using fd (rust find replacment)
  • list content of each one
  • pipe that into a file for safe keeping
$ for x in $(fd -e tar) ; do (tar tvf "$x" && echo "\n") ; done > /tmp/example_manifest
\- [ tar ]