The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 05:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 03:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl Linux 5 07-30-2007 05:26 AM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr HP-UX 1 10-16-2006 01:16 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 06:44 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-30-2008
Registered User
 

Join Date: May 2008
Posts: 1
tar command.

I have a big file, I would like to use command tar
Can I compress it 2 files with command tar ?

I have data : file1.Z
my target : archive files, file1.tar and file2.tar

many thanks.
Reply With Quote
Forum Sponsor
  #2  
Old 05-30-2008
Registered User
 

Join Date: May 2006
Location: England
Posts: 265
Quote:
Originally Posted by photo View Post
I have a big file, I would like to use command tar
Can I compress it 2 files with command tar ?

I have data : file1.Z
my target : archive files, file1.tar and file2.tar

many thanks.
No offence but I believe you have not fully grasped what TAR does. It stands for Tape ARchive and should be taken as such. The TAR function will not compress the archive and the compress program would need to be used afterwards. This of course will be pointless as you cannot really compress an already compressed file! I hope this helps.
Reply With Quote
  #3  
Old 05-30-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
tar is an archiver, no compression tool. If you want to compress only 1 file, you can use one of those: compress, gzip, bzip2, ....

I didn't get it, what you want. Do you want to put the 2 tar files together and compress them or uncompress the file "file1.Z"???
Reply With Quote
  #4  
Old 05-30-2008
Registered User
 

Join Date: May 2008
Posts: 77
While tar is an archiver, and the old school of thought is that it cannot do compression, there is the j and z option on gnu tar to compress "in stream" sort of.

tar(1): GNU version of tar archiving utility - Linux man page

tar -z for gzip
tar -j for bzip2 (higher compression, but slower)
tar -Z for compress, for low compression but compatibility with older systems.
Reply With Quote
  #5  
Old 05-30-2008
Registered User
 

Join Date: May 2008
Posts: 1
Quote:
Originally Posted by mark54g View Post
While tar is an archiver, and the old school of thought is that it cannot do compression, there is the j and z option on gnu tar to compress "in stream" sort of.

tar(1): GNU version of tar archiving utility - Linux man page

tar -z for gzip
tar -j for bzip2 (higher compression, but slower)
tar -Z for compress, for low compression but compatibility with older systems.
Do most systems come with the options above? Or are the compression options dependent on the version you have? I am just understanding the tar process and was wondering whether or not I should be compressing files, too. Thanks.
Reply With Quote
  #6  
Old 06-02-2008
Moderator
 

Join Date: Sep 2007
Location: Germany
Posts: 1,031
Dependent on the version - if you don't want to check what options tar can take for compression, just
1. tar it
2. compress it
So that you get a "myfile.tar.gz" for example.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0