Amiga.org
The "Not Quite Amiga but still computer related category" => Alternative Operating Systems => Topic started by: weirdami 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:
-
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.
-
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
-
Hey, check me out, cult member!
Crow, you seem kind of different... ;-)
-
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
-
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. :-)