LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



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

Rep: Reputation: 53
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
 
Old 05-21-2005, 08:53 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
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
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,428

Original Poster
Rep: Reputation: 53
Hi homey,

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

B.R.
satimis
 
  


Reply


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
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 12:02 PM
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 10 02-23-2008 06:40 AM
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 10:54 PM.

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