Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-21-2005, 06:33 AM   #1
Senior Member
Registered: Apr 2003
Posts: 3,637

Rep: Reputation: 54
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.


Old 05-21-2005, 08:53 AM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
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
Old 05-21-2005, 08:05 PM   #3
Senior Member
Registered: Apr 2003
Posts: 3,637

Original Poster
Rep: Reputation: 54
Hi homey,

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 12:02 PM
Flag question of Tar command satimis Linux - General 8 06-28-2005 10:59 AM
tar command question American Psycho Linux - General 3 04-18-2004 10:21 PM
tar command gogo Linux - General 4 11-17-2001 10:53 AM

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration