Extract one file from tar

Recently I've got asked from a client to restore an image and especially a favicon.ico for a large forum. That file is just 1kb and the whole backup 11GB! In that case the following commands are our big friend wink

The following command will extract the file called favicon.ico from the backup folder domains/mydomain/public_html/ into the existing directory

tar -zxvf mytar.ball.tar.gz domains/mydomain/public_html/favicon.ico

If you want to extract that file into a specific directory (in our example into the /tmp directory) use instead the following syntax:

tar -zxvf mytar.ball.tar.gz -C /tmp domains/mydomain/public_html/favicon.ico

Posted on: 14/04/2011








0 Comments
If you want to leave a comment please Login or Register