↑ ↓ select, Enter open, Esc close

List the contents of a tar.gz archive

Adjust the values, the command updates live
user@server
tar -tzvf /var/backups/example.com-httpdocs-2026-10-09.tar.gz | head -50

Shows the first 50 entries of the archive with permissions, owner, size, date and path. This tells you whether a backup contains the expected files and how the paths are structured, which matters for restoring individual files. If the archive reads through to the end without errors, it is at least readable.

Note: To search for a specific file, use | grep wp-config instead of | head -50.

Also searched as

  • list tar.gz contents without extracting
  • what is in this backup
  • view files in archive
  • check backup archive

Related one-liners

All in rsync and backup

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.