How to find and restore a single file from a .tgz archive

Find a file in a tgz file:
$tar -ztvf backup-1.tgz | grep file.txt
-rw-rw-r– user/user 43376920 2017-07-10 11:59 path/to/file.txt

Restore a file from a tgz file:
$tar -zxvf backup-1.tgz path/to/file.txt

Leave a Reply

Your email address will not be published. Required fields are marked *