know-how.dev

How to list file from tar.gz archive in Linux or macOS

3 years ago 768

Most Linux distros and macOS have tar program pre-installed by default, it can be used to list files in tar.gz archives. Command structure is next:

tar -tvf archive.tar.gz

What these flags mean:

  • -t - instructs tar that we are going to list files in archive;
  • -f archive.tar.gz - specifies archive file name to extract;
  • -v - enables verbose mode.