yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Terminal Lesson 16


2m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

Hey guys, this is McKinson, one with another terminal lesson on how to tar things and compress things.

Now I've had a few complaints about tar because my last terminal lesson, I think it was, I showed you how to tar files, and people said, well, what's the point of this? Because I can just zip and it makes the files smaller.

So I'm just going to be showing you how to use tar to not only tar up a bunch of files but also to zip the tar file that you create.

I'm just going to CD to my desktop, and now I'm going to make a document on my desktop that's going to be an empty document, and then I'll show you what next.

Okay, so right here on my desktop is this file. If we take a look at this file right now, it's 4 kilobytes, 178 bytes. So now I'm going to use tar to make a compressed version of this that's going to be smaller than that.

The command is pretty much the same; it's tar -z cvbf instead of just cvbf. It's -z cvbf space, then the name of the tar file, and that file is like file.tar.gz. So you have to add the gz after it, space, and then the name of the file that you're compressing, which is file.txt.

So now hit enter, and so here's my file.tar.gz, which is a tar.gz of this file. Now notice this is 146 bytes, while this is 178 bytes, so this is actually smaller.

Now, let's compare that to zip. Right now we're just going to zip file.txt. So right here is the zip; it's 181, and the tar is 146, which means that the tar is actually more efficient in this case than the zip.

I'm going to delete this file and just show you that this works when you untar; basically, it comes back up.

Okay, so now I'm going to show you how to untar this in terminal. You just type tar -zx vvf space file.tar.gz, and that'll untar it through terminal.

So just remember to add the Z before the vvf to make it compressed, and remember it's tar.gz instead of just tar.

So that's how to make an archive with tar.

Thank you for watching. McKinson one, subscribe, and goodbye!

More Articles

View All
Comparing P-values to different significance levels | AP Statistics | Khan Academy
What we’re going to do in this video is talk about significance levels, which are denoted by the Greek letter alpha. We’re going to talk about two things: the different conclusions you might make based on the different significance levels that you might …
Graphing a line given point and slope | Linear equations & graphs | Algebra I | Khan Academy
We are told to graph a line with a slope of negative two that contains the point four, negative three. We have our little Khan Academy graphing widget right over here, where we just have to find two points on that line, and then that will graph the line f…
Khan Academy Welcomes Duck Duck Moose
Hi, I’m Sal Khan, founder of the Khan Academy, and I’m Caroline H. Flexer, founder of Duck Duck Moose. We have a very exciting announcement today. As you probably know, Khan Academy is a not-for-profit with a mission of a free, world-class education for …
How One Man's Amazing Christmas Lights Have Spread Joy for 30 Years | Short Film Showcase
[Applause] [Music] [Music] [Music] [Music] My name is Bruce Mertz, and the people around here call me Mr. Christmas. This is my 31st year of putting up the lights, and I’ve been living here since 1977. Every year, I start setting up at the end of August.…
Eulers formula magnitude
In this video, we’re going to talk a bunch about this fantastic number e to the J Omega T. One of the coolest things that’s going to happen here, we’re going to bring together what we know about complex numbers and this exponential form of complex numbers…
The Horror of the Slaver Ant
Everything changed when the slaver Nation attacked. What used to be a thriving colony is now a captured country. Slaves do the work, serving their new Masters until they die, only to be replaced by new victims harvested in brutal raids. But let’s go back …