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
How Lawn Mower Blades Cut Grass (at 50,000 FRAMES PER SECOND) - Smarter Every Day 196
Hey, it’s me Destin. Welcome back to Smarter Every Day. If you’re like me, you’ve spent a ton of your life on a lawn mower, and you’ve been thinking about how the blade interacts with the blades of grass. So today on Smarter Every Day, we’re going to look…
Analyzing related rates problems: expressions | AP Calculus AB | Khan Academy
The base ( b ) of the triangle is decreasing at a rate of 13 meters per hour, and the height ( h ) of the triangle is increasing at a rate of 6 meters per hour. At a certain instant ( t_0 ), the base is 5 meters and the height is 1 meter. What is the rat…
The president's bully pulpit | US government and civics | Khan Academy
What we’re going to do in this video is talk about what is often referred to as the bully pulpit of the United States president. It’s making reference to the idea that the president has a platform from which they can convince people, that they can convey …
8 steps to get your sh** together
Here are eight steps to get your together. Step one: Tell no one. The urge to tell everybody you know, especially the people closest to you, about this big change you’re going to make is often overwhelming. Because it feels really good to announce to eve…
Do Technical Founders Need Business Co-Founders?
Oh yeah, well Michael, I could go do sales. That’s not hard. I can definitely reply to emails. Yes, you know, I could. Well, doter, are you going to do that? [Laughter] Welcome to Dalton Plus, Michael! Today we’re going to talk about, do you need a busi…
How Much I Make From YouTube #shorts
Hey, so for anyone curious how much I make on YouTube with three and a half million subscribers, here you go. I’ll take you into my analytics. So, in total, we did 110 million views this year, and as you can see, the views every day range anywhere from a…