- Alright, we already talked about it a little bit
but you can compress your backups.
By default, backups are not compressed.
And for compression the traditional Linux philosophy
is applied, which is connect multiple specialized tools
instead of building the required functionality
in all of the tools.
The only thing that is
that is included in, in Tar
is minus z, minus j or minus uppercase J.
And while using these options,
the appropriate compression tool is called.
So there are three main compression utilities.
We've already seen them in the previous video
but you can use them independently as well.
So gzip is one of them.
It has been the default tool for a long time.
It's fast and also compatible
to other operating systems.
You can easily use a gzip compress file
on windows, for instance.
bzip2 was later introduced
and it compresses in a more efficient way.
And xz is the most recent trend in backups.
The compression rate is great
but it is significantly slower.
Significantly, it takes double the amount of time or more.
Let's figure out how to work with these.
So we have the different files, right?
And if I use gunzip
on a files.tar.gz,
now what is it going to do?
Well, we can see what it's going to do.
It's going to,
to extract the tarball from the compressed file
and it overrides the tarball that already existed.
So what is the result?
We don't have the gz anymore.
It's really extracted.
Now let me remove this tarball. Yes.
And let's do something like this on a bzip.
what was the utility? bunzip.
A lot of step completion
if you're not sure about what you are doing
just type the first couple of
of letters of the command
and then you step completion to quickly verify.
And then it looks as if you're really smart
and if you really know what you're doing.
So bunzip2,
of files.tar.bz is doing what?
Well,
it's bunzipping.
There we go.
We have the tarball back again.
And once again, I'm going to remove it.
So last, there is xz.
xz minus minus help,
how do we uncompress with xz?
We use xz minus d for decompress.
Okay, here we go.
xz minus d
on files.tar.xz.
And as you can see, we have back our files. tar.
As you notice, all of these compression utilities
are really decompressing,
so you lose the original compress file.
And the only thing remaining is the decompress file
as you can see here.
And that's how you can use them.