>_ IzzyLab

Topic breakdown

Besides creating (-c) and extracting (-x), tar has a third mode — printing the table of contents (-t), which only reads the list of paths inside the archive without extracting anything to disk. For a compressed .tar.gz you add the gzip flag (-z), and -f specifies the archive file name. Mental model: reading the archive's metadata and materializing it into files are fundamentally different operations, and the list mode creates no directories. The list is ordinary text on stdout, which is redirected into a file.

What's checked

  1. the contents of the archive are listed in /root/listing.txt
  2. the archive was not extracted

What it looks like