Next, listen, we have Compressing and Uncompress Singh files.
There are a few different commands that we use to compress and compress files, but first of all, there
was a command that is used commonly in Lennix and that command is called thaat.
What does thaat do with all taht takes a bunch of files together and put it in one container or one
file, you could say is just like in windows.
You have a bunch of files and you zip them together.
So most likely the tar files does not compress as much as the actual G zip command.
The GS is the command is actually compresses a file and then there is a command GCIB minus D or guns
up.
These two commands are used to Uncompress a file.
So let's get to a question.
Our favorite question.
Why do we need these commands anyway?
It's a very good question.
Of course, to answer this question this way is what happens if a system crashes?
OK, you try to resolve the issue, but you cannot.
There is.
You tried everything, but you cannot find the issue.
You cannot get to the point where, you know, aha, that's the problem.
So what do you do?
Are you going to sit there and just, you know, try your endless hour to resolve and know what are
you going to do?
Is you going to call the support, you're going to call RedHat or the operating system support?
If you are running S.O.S, then most likely you are out of luck because most of the S.O.S has no support.
So I hope you are running, RedHat, in your corporate environment.
When you are running RedHat, you will get a support.
So you pick up the phone, you call them.
Then what happens?
They will tell you to send the files or logs to their website.
And sometimes there are so many logs, so many files that they ask you.
You have to put them together into one file or one container and you make put them all of them in one
container.
And that is when you're doing thaat or in the next language, you could say tiring.
You put everything together.
All right.
So everything is together now.
Now with the file size is huge.
It will take so long to transfer.
So what do you do?
We actually compress it.
Once we compress it, the file size becomes a lot less than its actual size.
So we will try all these commands in our Linux environment one by one.
And this way you will understand how these commands work.
All right.
I am in my home directory and someone has asked me that.
Send me all your contents of your home directory.
So in my home directory, I have directories and files and maybe links and directories.
Subdirectories and within Subdirectories there are more directories.
So how do you put everything in?
One is the use a command tor and the option that I use is C the F.
You can look it up cbf option by running man.
But I've been using these three option letters for a long time and I know it will, it will compress
it a little and put everything into a file.
Then I would have to specify the name of the file that everything will come into.
So I'll just put myself because this is my home directory, I'll just put I on.
I'll just put tarde the in.
Why?
Because this will identify that this is a tar file and what are, what am I tiering.
I'm tarring this entire directory so I could do home.
I have solved this filter everything in that or I could simply do that relative path because dot dot
means thaat, everything or put everything that you see right now into a file called I absol data and
I run it.
You see all that messages come up on the screen.
Some of the messages that you will see Tor file is archive, not dump.
Forget that, don't worry about it because it's trying to tar itself.
That's where you are getting the message.
But anyway, when you get all that message, when you run this mysel tr and you will see right here
I saw Tor perfect.
Yes.
So now everything, all the contents, desktop templates, public, all these files and pictures I have
are all put in into this.
File.
How am I going to untie it?
Well, I don't want to enter it in the same degree with all the files already exist.
So what I will do, I will create a directory mkdir and I'll call it blah, blah, blah, whatever.
OK, the file the deck is created.
I'm going to move this.
I have za'atar file in tubeless directory.
It's moved.
Yes, it is moved.
I don't see it.
I will go into billi directory now.
I'm in Blood-Red tree.
Just make sure to run PWI.
Yes, home.
I was a block perfect.
Is the file there.
Yes it is there now how to untie meaning taking out all the contents from this file and putting in this
directory.
There's a mantar same thing.
But this time I would want x the F to extract everything.
And this is the name of the file.
I'll run it hit enter l come through all these untiring files and now when I do remember I am and home
I have Zogu blah and now and I do this myself here.
What should I see.
Well, I should see the exact same contents I have in my home, I have TSOL, I should see the same
contents here, if that's confirmed, Bengoa.
Yes, I do see everything right.
Perfect.
So I don't want all those contents in there.
I'll go one step back and I'll do it myself here again here.
And you'll see I have the same thing here.
Why do I need to keep two copies?
But of course was just a matter of explaining you.
So let's go back into BLOO and this time you'll see I have this file.
I have Zaldivar, which has everything.
Now, the size of it is 272 five eight eight eight zero.
But it's huge.
I want to compress it.
So that's compressive at Guiseppe GCIB I absol Dr. Simple is that hit enter.
You see, it took a little longer, but it did compress it.
Just look at the size right here.
Remember the size to seven two five eight eight zero.
Now, let's do it myself.
Here you see the file size went down eight zero one eight to nine eight.
It means it has hermitages to.
Four, six, seven.
This one has two, four, six and eight, so of course, this one was the size was a lot huger than
this one.
So it means it is compressed.
Then the next commander we have is Jesus minus D or gun.
What this does is basically uncompress it to do uncompress you do Guiseppe minus D or a game gunship,
which is right here g zip or gun zip.
I'll just use Guiseppe and I absol star hit enter.
Now, the files I should come back to, the same one we have right here, this is the original file
size, I remember.
And yes, we did get original files, so we have to file the cheeseboard we compressed it.
We uncompress it.
We'll go back to our home directory and we do have this directory and we'll simply get rid of this blah
directory, which is remove mines are for removing directory or MDI are to remove it, but that is not
empty.
So what we'll do will do minus F to force it.
I think my arm dealer myself does not work here, so I'll do r A minus R f this definitely work.
Yes, it does.
It's gone.
Directress gone.
So this is how the tour is explained in simple words.
I want you to try the tar file to tar your own home directory, grabbing it and then unzipping it.
Or you could even simply take any file that you like and zip it and see if this file size reduces.
And again, the purpose of these commands is if you win, if you have to transfer files from one computer
to another or to send it to someone, the file size are huge and the transfer will take a lot longer.
And that is why we put them together into Tor and compress it so it becomes smaller and smaller and
the transfer becomes easier.