Visit Jeremy's Blog.
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, 05:33 AM   #1
Senior Member
Registered: Apr 2003
Posts: 3,576

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, 07:53 AM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 58
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, 07:05 PM   #3
Senior Member
Registered: Apr 2003
Posts: 3,576

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
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 10 02-23-2008 05:40 AM
Flag question of Tar command satimis Linux - General 8 06-28-2005 09:59 AM
tar command question American Psycho Linux - General 3 04-18-2004 09:21 PM
tar command gogo Linux - General 4 11-17-2001 09:53 AM

All times are GMT -5. The time now is 01:19 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