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
See How Dancing Helps This Young Refugee Feel Welcome in a New Country | Short Film Showcase
[Music] [Music] [Music] We’re gonna do the question of the day. I am from Karachi, Pakistan. I’m nervous but got them from blast. Everyone looking for my face. I want to be a little bit challenged, so to be ready in September for school, you need to anal…
Everything wrong with my $100,000 remodel ...
What’s up guys? It’s Graham here, and I got to say I’m really happy that so many of you have been reaching out to me asking for an update on the status of this renovation. I’ve been a little hesitant about posting sooner because I wanted to wait until mor…
5 AMAZING Experiments and "Sauciest of the Week" !
Hey, Vsauce. It’s Michael with two big announcements. Count them, two. First of all, there’s a brand new episode of Vsauce Leanback that you can start by clicking the link at the top of this video’s description. This week the topic is crazy and classic s…
15 Things You Envy In Other People
Nothing says I have no confidence in myself more than envying other people and being obvious about it. They seem to have it all while you’re here, stuck yet again. Well, today we’re talking about 15 things you envy in other people, so you can start doing …
How to wake up early and not be MISERABLE~Tips from a master of waking up early 🌞🌟🌈
Do you ever just wake up and go, “Nope,” and roll over and go back to sleep? Then this video is for you! Hi guys, it’s me, Judy. Today, as someone who masters waking up early, I want to share with you guys my tips and some scientific background tips to he…
Persistence Of Vision
So tonight I’m hanging out with my friend Nigel, and he’s brought along one of his science toys—a little white plastic ball. Um, it’s not actually a white plastic ball at all. You told me you were bringing the white plastic ball tonight. It’s, uh, what co…