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
Differentiating power series | Series | AP Calculus BC | Khan Academy
So we’re told here that ( f(x) ) is equal to this infinite series, and we need to figure out what is the third derivative of ( f ) evaluated at ( x=0 ). And like always, pause this video and see if you can work it out on your own before we do it together.…
Strategies for adding 2-digit numbers | 2nd grade | Khan Academy
So let’s do a bunch of examples from the Khan Academy Exercises to get comfortable with different ways of adding numbers. So this says, select any strategy that can be used to add 78 plus 9. Select all that apply. So this first choice is 77 plus 10. We…
Multiplying using area models and the standard algorithm
What we’re going to do in this video is multiply the numbers 352 and 481, and we’re gonna do it in two different ways. But realize that the underlying ideas are the same. So first, let’s just appreciate that 352 can be rewritten as 300 plus 50 plus 2, or…
Shower Thoughts That Keep Me Up At Night
Morning people run. Society, we march to the rhythm of their drumbeat, and yet, on average, they are less intelligent than the night owls. They are, however, more likely to be happy, so let’s call it a draw. A person who coined the term “living room” mus…
Stolen Mummy's Left Hand Found and Returned to Egypt | National Geographic
We have a repatriation of ancient artifacts from Egypt. It includes a child sarcophagus about 2,600 years old, the top of another mummy sarcophagus, a burial shroud from inside a mummy sarcophagus, and finally, there is a mummified hand which was collecte…
Sample statistic bias worked example | Sampling distributions | AP Statistics | Khan Academy
We’re told Alejandro was curious if sample median was an unbiased estimator of population median. He placed ping pong balls numbered from 0 to 32, so I guess that would be what, 33 ping pong balls in a drum and mixed them well. Note that the median of th…