Re: Compressing folders/sub-folders with TAR : how to ?
From: Stephane CHAZELAS (this.address_at_is.invalid)
Date: 01/26/05
- Previous message: Bill Marcum: "Re: Compressing folders/sub-folders with TAR : how to ?"
- In reply to: A Web Master: "Compressing folders/sub-folders with TAR : how to ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 26 Jan 2005 17:47:18 +0000
2005-01-26, 06:57(-08), A Web Master:
> What's the syntax to compress all folders and sub-folders found with TAR ?
tar is not a compressor, that's an archiver. tar makes an
archive, it provides with a stream of data containing the
representation of a directory tree.
Compression is the job of other tools like gzip or compress or
bzip2 whose role is to take an arbitrary stream of data as input
and produce a compressed stream of data as output.
tar cf - . | gzip > ../file.tar.gz
creates a compressed archive of the current directory (.) stored
in the ../file.tar.gz file.
3 tools were contributing in making that archive:
1- the shell that created and opened the file for writing and
launched and connected the two other tools together.
2- tar that produced the archive stream on its standard output
(with the -f -, otherwise by default, tar would put that stream
on a tape as it's a Tape ARchiver).
3- gzip that read the data from its standard input (that was
connected to tar's standard output via a pipe created by the
shell (and managed by the Unix system)) and wrote the compressed
data on its standard output (that was connected to the file by
the shell).
That's a simple example of how you can combine simple tools
together to have them perform a more complex task.
-- Stéphane
- Previous message: Bill Marcum: "Re: Compressing folders/sub-folders with TAR : how to ?"
- In reply to: A Web Master: "Compressing folders/sub-folders with TAR : how to ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|