NuxOra – Linux and Oracle IT website

Admistration, configuration, déploiement, optimisation et tuning.

How to extract files from a tar.gz

usually people do:
$ cd backup/2007/02
$ tar -zxvf data.tar.gz

you can simply do:
tar -zxvf -C backup/2007/02 data.tar.gz

or even do it better:
cd backup/2007/02 && tar -zxvf data.tar.gz

the best way:
cd backup/2007/02 || mkdir -p backup/2007/02 && tar -zxvf data.tar.gz

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>