LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Tar command question (https://www.linuxquestions.org/questions/linux-general-1/tar-command-question-325622/)

satimis 05-21-2005 05:33 AM

Tar command question
 
Hi folks,

With following simple tar command a tarball can be extracted to the "designated_directory"

$ tar zxvf /path/to/xxx.tar.gz -C /path/to/designated_directory/

What flag shall I use to do the job creating the "designated_directory" simultaneously if the latter has not been created.

TIA

B.R.
satimis

homey 05-21-2005 07:53 AM

I use this to create the tar
tar -cvzf backup.tar.gz ./images

and this to restore the tar to a directory which may not already exist.

mkdir -p /mnt/backup | tar -xvzf backup.tar.gz -C /mnt/backup

satimis 05-21-2005 07:05 PM

Hi homey,

Quote:

I use this to create the tar.....
Noted with thanks

B.R.
satimis


All times are GMT -5. The time now is 11:45 PM.