Welcome, Guest. Please login or register.

Author Topic: tarball or gzip doing on unix  (Read 939 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline weirdamiTopic starter

  • Hero Member
  • *****
  • Join Date: Jan 2003
  • Posts: 3776
    • Show only replies by weirdami
    • Http://Bindingpolymer.com
tarball or gzip doing on unix
« on: July 21, 2004, 11:18:25 AM »
How do I do one of those tar ball things or gzip dealies on a unix system? I have an email directory on Sparc something, and I want to squish up all the emails into one file.

Really, I suppose, I want to be able to type in a command that indicates which directory to archive, and have it archive all the files into one file, rather than into a bunch or individually archived files, which seems to be all I know how to do. :-(

man files are evil, which is why I'm asking you knowledgible folks. :-)


-edit-
Hey, check me out, cult member! :banana::banana::banana::banana:
----
Binding Polymer: Keeping you together since 1892.
 

Offline elendil

  • Sr. Member
  • ****
  • Join Date: Nov 2002
  • Posts: 324
    • Show only replies by elendil
    • http://www.idiot.fnuck.dk
Re: tarball or gzip doing on unix
« Reply #1 on: July 21, 2004, 11:40:21 AM »
Quick answer: tar czf .

a bit longer:
c - create archive
z - gzip compression
f - filename

You don't need z if you don't want it compressed. Using x (extract archive) instead of c does the opposite when you want your files back.

I don't know, but I'm sure it's also possible to either use wildcards or just type the list of files you want to have tarred instead of , if you prefer.

Sincerely,

-Kenneth Straarup.

EDIT: the flags can come in any order, btw, cfz fzc, etc, afaik. It may depend on tar implementation, though.
 

Offline Jope

Re: tarball or gzip doing on unix
« Reply #2 on: July 21, 2004, 11:46:52 AM »
Sparc something would indicate solaris, so the z flag might not work.

Just leave it out and then do a gzip -9 file.tar after you've rolled up the package.

Edit: Wow, I've turned into a cult member too.. :-D
 

Offline Ilwrath

Re: tarball or gzip doing on unix
« Reply #3 on: July 21, 2004, 01:24:09 PM »
Quote
Hey, check me out, cult member!


Crow, you seem kind of different...   ;-)
 

Offline Failure

  • Lifetime Member
  • Sr. Member
  • ****
  • Join Date: Jun 2004
  • Posts: 332
    • Show only replies by Failure
    • http://awhitlock.net/
Re: tarball or gzip doing on unix
« Reply #4 on: July 21, 2004, 02:36:54 PM »
Quote

Jope wrote:
Sparc something would indicate solaris, so the z flag might not work.


You are correct!  Without the GNU version of tar being used, the -z or -j flag for compression won't work.  However, instead of tarring and then gzipping, do it all at once with:

tar -cf - directory_to_be_tarred | gzip -9 > whatever.tar.gz

For transit on a DOS floppy (like say, to an Amiga) use .tgz instead of .tar.gz
--
Failure
You can\'t spell evil without "vi"
AMIX Wiki | AmixBP
 

Offline weirdamiTopic starter

  • Hero Member
  • *****
  • Join Date: Jan 2003
  • Posts: 3776
    • Show only replies by weirdami
    • Http://Bindingpolymer.com
Re: tarball or gzip doing on unix
« Reply #5 on: July 21, 2004, 11:16:05 PM »
Thanks, guys, it worked first time. That -z thing wasn't in the -h, so I guess you were right about it not being on Solaris. Hadda gzip. Now my many emails take up tiny space. :-)
----
Binding Polymer: Keeping you together since 1892.