Hey, welcome back to this video.
So in this video, we are going to learn about archives and how you can compress files and directories
into Linux.
We are going to see different compression techniques.
Also, we will see how you can zip and unzip or extract those archives.
So let's quickly begin with the first one.
So first, let's quickly go into a directory where we are going to compress a directory.
So let's go and U.F.O. net, which is the directory in which you can see I have already created a directory
named Rohith.
So let's see what's inside it.
And you can see there is a file which is dot text, which contains the content or the text, which is
I love hacking.
All right, so let's go one step back using seed, dot, dot, and now we are back again in the UFO
net directory.
All right.
So the first thing or the first command that we are going to see is TAR.
So basically, we are going to create a tar named archive, which is archive tar, which will contain
the directory, which is root.
And for that the command that we are going to use is tar compress, eff archive, dot tar, which is
the name that we are giving to our archive and the directory that you want to use or which you intend
to be compressed.
All right.
So we have finally compressed Rohit directory into archive to TAR.
Now you can also decompress it or you can decrypt it using the command which is tar x, v, f and the
tar name or the compressed file name.
As you can see, it has finally decompressed it and you can see the content, which is Rohit Slash hacked
text inside it.
Perfect.
Now let us move forward.
And now we are going to see how you can create a GZIP compressed tar file, which is a zip based tar
file.
So for that, the command that we are going to use is tar C said F, you can add the hyphen or the dash.
It is not compulsory without it.
Also the command will work.
All right.
So Tar C, Z, F and archive dot, dot, dot, gz and directory that we want to unzip or compress is
Rohit.
As you can see, it has finally created a zip file which is archive dot dot, dot gz.
Perfect.
So this was the second method or the second way through which we can compress the files.
Now let's quickly extract the gun, zip or g zip files for that.
The command is tar, x, z, f and the archive name which we have recently compressed.
And now this will decompress it.
Perfect.
So in case sometimes you download a few files from the internet or there are some programs or binaries
from GitHub which may be gun zipped.
So this is the command through which you can decompress it and finally use it.
Perfect.
Let's move forward.
And now we're going to choose the same directory, which is right again.
But this time we are going to create a TAA file with B zip two compression.
Now this is again a new technique of compression that we are going to use.
You may come across many times these types of compressed files on GitHub and other various websites.
So that is the main reason I'm showing you how you can create these types of compressed files.
And if in case you have downloaded it, how you can decompress it now to create a B zip to compression,
you simply have to type the command, which is DA, C, G, F and archive dot dot, dot, b, z two
and the directory name which is Rohit Perfect.
So we have successfully created a new archive with B sub two compression.
Now in case you want to decompress it, the command would be tr, x, g, f and archive dot dot visa
to perfect.
This will decompress it again into the original directory, which is Rohit.
So this is it for this video.
I hope you guys understood three methods to compress and decompress the files.
Thank you.