LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2010, 12:47 PM   #1
Katie59
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Rep: Reputation: 0
Turn a .tar file into a .tar.gz?


This has probably been asked before and if it has, I'm sorry, I just don't have time to search for it right now.

I have a bunch of times that are in .tar format, and need to be made into .tar.gz. How do I do that? I really don't want to go through and manually compress each and every one, because there's a lot of them!

Thanks as always for your help
 
Old 03-12-2010, 12:50 PM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
Code:
gzip *.tar
 
Old 03-12-2010, 12:59 PM   #3
Katie59
LQ Newbie
 
Registered: Feb 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Wow, yea, I really should have been able to figure that out on my own.

*blush*

Thanks!
 
Old 03-12-2010, 03:35 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
also consider creating tarballs in one blow:
Code:
tar -cvjf dir-name dir-name.tar.bz2 # to compress
tar -xvjf dir-name.tar.bz2 # to extract
 
Old 03-12-2010, 03:49 PM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
Quote:
Originally Posted by schneidz View Post
also consider creating tarballs in one blow:
Code:
tar -cvjf dir-name dir-name.tar.bz2 # to compress
tar -xvjf dir-name.tar.bz2 # to extract
Replace 'j' with 'z' for gzip instead of bzip2.

Also with newer versions of tar you do not need to specify 'j' or 'z' when extracting, it automatically detects it and runs gunzip or bunzip automatically.
 
  


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 Off
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
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 04:15 AM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 02:04 PM


All times are GMT -5. The time now is 09:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration