Extracting data from tar.gz

If you find this free website useful – why don’t you support this with a donation? It is easy…. read more ….

cpanel creates backups in tar.gz format, sometimes you want to recover a single file  from the tar gz file.

If on linux you can extract everything into a spare directory and work from there using the following command suitably edited

tar -zxvf mybackup.tar.gz -C /home/myrecovery


If you need to see what is in the tar.gz file use

tar -tvf mybackup.tar.gz


If you want to recover a specific file of directory tree e.g. for a database in myaccount/mysql/mydatabase.sql then is can be done with

tar -zxvf mybackup.tar.gz myaccount/mysql/mydatabase.sql -C /home/myrecovery


if the recovery directory doesn’t exist or omitted the files are expanded into the current directory



, ,




Leave a Reply

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