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

Terminal Lesson 21


2m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

Hey guys, is mad kids in the one? Before I start this terminal lesson, I will say that I am in the car, so that's why the audio is kind of mixed up.

Anyway, in this terminal lesson, I'm going to be showing you how to use a few new commands. Two of them are like math-solving problems. So, like, if you have, like, take 10 times 9, they're like calculators.

Then, I'm going to show you how to get a calendar on your computer through terminal. So first of all, a lot of people have asked me why does the Linux command calc work, but why can't I not use anything like it on the back? Well, the truth is that you can.

There was something called bc, which is the precision calculator. It's actually the arbitrarily precision calculator because, um, it uses 64-bit numbers, so longs, for instance, and doubles instead of floats. So it is very accurate.

So if I do 10, I don't know how the got number is, it will actually give me an answer. Should I do something more like this, it will successfully work with most calculators or will not work. This is how accurate this is—it's like a 20-digit calculator. To get out, you type quit or exit. You can't just press control C.

So that is the precision calculator. The next way to do this that shell scripting uses a lot is something called expr. So you do expr space and then the equation 10 times 9.

And for actual times, you have to use backslash star, but if I do just plus, that works. And you—I'm not sure if you can do, like, then after this x 3. What do you know?

So there we go, that seems to work. So expr is a great way to do it. What you do for shell scripting, of course, if you're setting a variable, you'd say foo=expr n + 3, and then do a carriage return.

So that's how shell scripting you take expr to advantage to use for math problems. So just thought I'd throw that out there.

Okay, so the next thing is calculator in that calculator calendar. So let's say I would love to know how many days until my birthday.

So what I can do is I can take the cal. Cal is a command, and I just said cattle. It'll give me the current month in these like the first, second, etc. I can do cal -y to show me the actual day of the year, so that's pretty cool.

Then if you do -Y, it'll give you the entire year. Now, say you want to figure out how long from now until the last day of the year.

So I believe that today is the first of Latinas, so that's the 213th day. So you have 365 minus 213, and that's how many days are left.

So that is how to use the calculator. You can also do cal --help to get all the options, or you can do man cal. So that is how to use the calendar and do math problems with terminal.

So thanks for watching, my kids in one! Subscribe and do…

More Articles

View All
Identifying centripetal force for ball on string | AP Physics 1 | Khan Academy
What we’re going to do in this video is try to look at as many scenarios as we can where an object is exhibiting uniform circular motion. It’s traveling around in a circle at a constant speed, and what we want to do is think about why it’s staying on the …
What Happens If You Destroy A Black Hole?
Black holes can destroy everything – but can they be destroyed? What happens if we push physics to the absolute limits, maybe even break it and the universe in the process? Let’s create a tiny black hole, about the mass of our moon, in the Kurzgesagt Labs…
15 Ways to Get Your Act Together For a New Chapter
7 years from now, it’s going to be 2031, almost 2032. And if you’re coming from the future, hello! Nice to have you here. But for now though, when this video is being made, it’s 2024, and you’re either in the middle of your long-term goals, at the end of …
Nietzsche - Follow No One, Trust Yourself
In Thus Spoke Zarathustra, in the chapter called The Bestowing Virtue, Friedrich Nietzsche wrote something surprising. Zarathustra—a sage who is also the central character of the book—tells his followers to stop following him. He says, “I now go alone, my…
Dilating in 3D | Solid geometry | High school geometry | Khan Academy
Let’s say I have some type of a surface. Let’s say that this right over here is the top of your desk, and I were to draw a triangle on that surface. So maybe the triangle looks like this, something like this. It doesn’t have to be a right triangle, and so…
Warren Buffett: How Smart Investors Easily Identify Terrible Stocks
In the end the better mouse trap usually wins but but the people with the second or third best mous trap will will try to keep that from happening. I the ones you name I don’t know anything about I mean I know what they do but I don’t I don’t know they sp…