 Today we're going to plot some basic things in our shell. There are a lot of applications out there, programs out there for creating charts and graphs and plots. I wanted something that runs in the terminal. I searched it and there are a lot of options out there, but I wanted something very simple and I wanted something that preferably is in the default repositories for my distribution. And what I came across was TTY plot. Now again, it's not the prettiest, but if you just need a quick graph, this works fine. And I'm just going to show you some examples of it. So at least on my Debian base system, sudo apt install TTY plot. And then you can use it and then you just have to pass it some numbers and there's a few options for it. But let's go ahead and give it a try. We're going to look at a few different scenarios here. So first, what we can do here is if I was to ping my web server films by chris.com. It's a great website. You should check it out. I want to grab this delay in milliseconds. So let me go ahead and do that. So what I'll do is I'll run the same command, but with a said command after it saying basically to strip away everything other than that milliseconds here. We could go further and strip away these letters here, but TTY plot is smart enough to know to just grab those numbers. So what I can do is I can run that same command again and I can put it into TTY plot. So we're going to ping, we're going to basically remove everything but the milliseconds and then we're just going to pipe that output into TTY plot. And there we go. It starts plotting out every ping and we have here the highest that it's received. And then you can see, of course, the bar is coming across. And then we have the last one we got the minimum, the maximum and the average. And then we can actually add some other options to that. So if we want to, I can hit control C to get out of that. Let's clear the screen. Let's run that same command again, but I'm going to add the dash T for title. And I can say pings. Let's make this a little smaller so you can read it all on one line. When I run that now at the top of the screen says pings, right? But we're also just getting numbers here. What do we always tell our kids in school? What are the units? Be sure to use your units. Control C to get out of that. Let's go dash U to give it a units. And I'm just going to say MS for milliseconds. And now down here at the bottom, it says MS and up here, it gives us our units of milliseconds. And that's great. Now let's go ahead and try pinging something else. So instead of just my website, we can ping a server. We'll just do 8.8.8.8. And again, we will get the milliseconds delay for that. Let's do something that might give us a lower number. Let's go ahead and just ping my server or not my server, but my router, right? There we go. Much lower numbers. You see, it is adjusting the maximum height to whatever the maximum number it gets in. So the maximum I've seen so far is three. And so we have three up here. But we can change that. So what we can do is we can say dash S. And that's for the starting maximum. And I will say, so we were at three, four, I'll say five. Now it starts at five and gives us a graph more towards the middle so it's not maxing out at the top. There are other options to set what happens when you hit a max and low and all that. We're not going to get into that in this video. But let's look at another option. Of course, we can use different applications like top or H top to see memory usage and get them graphed out. But I just say free dash H will show me the free memory and human readable. I can just say free to get it without going into gigs. There's going to be bytes. But let's go ahead and take that. And I have swap. I just want the memory line. So I'm going to grep for lines to start with mem. There we go. I've got that line. And then what I can do is I can take that and put that into an odd command that's going to grab the third column, which is the used. So right now I'm just getting the used, sorry, excuse me, the amount of RAM being used, which is 2.8 gigs, and now I'm getting it in bytes because I removed that dash H. Let's run the whole thing. We'll do it with the human readable. And I can do it with a sleep option of one. So it's going to loop. I'm just going to put a delay of one in there. I'm going to do that. And so every second is going to give me the how much RAM is being used. So I have my screen recorder going and I got some videos being processed. Let me try to bump up the RAM that's being used. I'm going to open up blender on another screen. There it went up a little bit. I'm going to open up maybe writer, office writer, see if that goes up a little bit. Yeah, then went up to 3.1. And of course, the big memory hogs on machines. I'm going to open up two web browser. I'm going to open up brave browser, let that load. And then I'm going to open up Firefox. Let that load. Of course, I'm doing these off screen just so you can see the memory usage there. So it's going up, it's going up. And then of course, I can open up websites. Let me close all of that. Close those web browsers, close office, close blender. And now let's put this into TTY plot. So we have this loop, we're just going to pipe it into TTY plot. And again, you can give the other options for title and your units. But let's just do this for now. Again, we're using just under three. I'm going to open up blender, blender. I'm going to open up brave. I'm going to open up Firefox. And we can see as I open up things, you know, as you're going up, let me go ahead and just click on like a bunch of websites here. We'll go to Facebook and we'll go to Amazon and whatever website there is. I mean, Google, but that's not really, I'll just click on the Google homepage. So you can see as I'm doing things, the memory usage is going up. And of course, if I was to close those windows, it's going to start going back down. So we're able to graph that out. And again, we're looking at gigs. So we can always give it its dash units. And we'll say GI or G or GB, whatever, whatever units you're using. And that's great. So yeah, so we looked at pinging. We looked at grab memory usage. Let's look at one other thing. What if you have a static file? So I list here, I'm in a folder and I have some JSON here. This is from FPL Florida power and light. This is my daily usage for the year 2020. So if I was to cat that out, we can see it like this. If I was to pipe that since it's a JSON file, I can type it into JQ and it filters out for me. I can use JQ to filter through all of this, but I'm just going to quickly grep for kilowatt hours usage, boom. And then I can say something like awk and I will print the second column. Oh, oh, I just gotta say print, print, second column. There we go. And I don't think I need to remove that comma, but let's go ahead and use TR to, or yeah, TR to delete the comma. So we just get numbers, right? So if I was to take all of that and pipe that into TTY plot, we saw it for a second and it exits out, right? So it displayed an exit out because it's not giving regular data. Now, of course, I could put this in a loop and delay it and stuff. But if you want the data to stay up on the screen, what you can do is use term equals dot TV 100. So we're going to just go ahead, run that same command. But right here, we're going to say term equals TV 100. And now we applied it out. Some of it went off the screen because that was a lot of information, 366 lines. And it actually, even though there's only 365 days in a year, I don't know what that was about. They just probably have the day before New Year's or something on there. So yeah, and then of course, we can take all of that. And we can say something like this. We're going to cat out that file into JQ. We're going to get the information we just want. We're going to set it so it stays on the screen. I'm going to set title saying power usage 2020. I'm going to set our units to kill kilowatt hours. And there we go. So I get that plotted out and see at least the last half of the year. Of course, I can break that down and see it as it goes through the year if I want. You can also change the character so it's not lines. That's a few other options. Again, it is not the prettiest, but it's a very simple option that is in the repositories, at least for Debian Sid. I didn't check other versions of Debian. But I hope you found this useful. Again, it's just a quick, easy way to get plots. Again, I know there's other applications out there that are prettier, may have more features. And you know what? If you like one of those, let me know in the comments below and I'll see if I can check them out. Again, I prefer things that are in the default repositories for my distribution. But if it's something very useful, I might go outside of that. So something like this, I'm not going to be using this a lot. It's going to be something I use occasionally. And that's why I was okay with not going through the extra hurdles. Plus, I don't like going outside of my default repositories when I don't have to. I do sometimes, but I try not to. Anyway, filmsbychrist.com, that's Chris of the K. There is a link in the description of this video to there. Also, I have a handful of patreons. In a previous video I said I only have ever had more than 10. I actually have 12 patrons right now on Patreon. You could be one of them. And I really appreciate it. Even if it's just a dollar or two a month, everything I am thankful that I get. But I do have a lot of viewers. And obviously, if I have around 60,000 subscribers, I only have 12 supporters there, I could probably get some more if I maybe ask a little bit more. So I'm asking. If not, if you can't do that, or if you'd rather use LibrePay or PayPal, there's links to that on my website. You can also support me by liking, sharing, subscribing, commenting below. I hope that you have a great day.