Restore a single file from a tar backup
extract single file from tar.gz | restore one file from backup | restore wp-config from backup | recover deleted file from archive | tar | restore | backupCaution: This command changes the system. Understand what it does before you run it.
mkdir -p /tmp/restore && tar -xzf /var/backups/example.com-httpdocs-2026-10-09.tar.gz -C /tmp/restore ./wp-config.phpExtracts only the given entry into the target directory. The path must be specified exactly as it appears in the archive, so for archives created with -C PFAD . it needs the leading ./. Entire subfolders such as ./wp-content/themes can be extracted the same way.
Note: tar -tzf ARCHIV | grep NAME shows the exact path beforehand. A file with the same name in the target is overwritten, so use a separate restore directory.
Also searched as
- extract single file from tar.gz
- restore one file from backup
- restore wp-config from backup
- recover deleted file from archive