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

Terminal Lesson 12


3m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

Makin's 101 here. Today I'm gonna be showing you about the process system in UNIX. Now, this is a video for the people who actually want to learn something about the Mac and how their Mac works. Now for people who want to just do something really cool in terminal.

So first of all, let's go into something called top. You just head t.o.p. You can see a few processes that are running on this machine. You can see PID, commands, CPU time, a bunch of other crap. And now like the CPU is the CPU usage, like I show you, which is what I used to film this, is using 83%. And then top, which is the actual program which I typed into view, this is using 4%. Of course, terminal is using a little, and you can see this isn't basically no order whatsoever.

So I'm gonna show you how to organize these by CPU usage. So let's press ctrl C to get out of top, you'll see. And let's press, now we're gonna go into them, gonna take top, space -o, space CPU. And now top -o CPU is going to sort the processes by their CPU usage and this is the most useful role of all the things: top -o CPU.

So now you can see I show you using the most CPU is at the top. Windows server is six point one, terminal right there. Everything keeps on moving around because the CPU keeps on changing. So we just sorted them by CPU now.

So, sort them by command, now they’re sorted in alphabetical order, top down. So from USB em, uxb down to like mcx ALR, that's enough of medical order. Not as useful when it's control cx8 once again. And also, you can, there's a way of viewing all the processes. You want to type PS space ax, now hit enter.

Now PSA yo X will display all the processes once. Don't scroll way off of your terminal, maybe even let go off the screen. You can see this didn't right there sorted by CPU. You can see these are all my processes running, just clear the screen.

We can also type PS space ax space pipe, which is shift backslash. Now, if you don't know where the backslash key is, you don't have to do this feature. When it's PS space aux space shift backslash, which is a pipe, looks like a vertical bar right there, space grep GRE p space and then process name. Probably let's look for I show you.

And this is case-sensitive, don't forget that. It'll show you all the lines containing "I show you". See, here is users Alex applications I show you, etc. Well, right here is grep I show you. That's because grep is actually a program that looks, so let's check that again.

And now we can search for anything we want. Let's search for one. Still gonna be a ton of commands there, 'cause we did grep space one, searches for one and pretty much of all the lines have one in them somewhere.

No, the number things, so that's sort of like useless. If you want to just view all the processes, you do instead of grep something PS space aux space vertical bar or pipe, shift backslash, whatever you want to call it, space more.

Now just display the first page of your processes. Then you would spacebar to go to the next page, and yet spacebar to go to the next page. Now this isn't so useful on such a small terminal, but it's all you can really see. So just keep on going down.

And now after a while if this gets boring and you can't get to the bottom, you know, just press Q. If you're in this and you've done more and you don't want to keep on anything space a bunch of times, your old space down, you just press the Q key, no, quit out of more, which is the PS aux more and that's how to view the processes.

Now let's show you something on top. Another thing is the PID, that's the process ID. That ID is unique for all the processes. So instead of using the name like parental controls, you would want to use the process ID right here.

You can see parental controls is 8 8 8. I can just control C out of this and type kill 888, operation not permitted. And this is because root is actually running in 80. Let's explain this exactly. Parental controls is 8 8 8 right here, can't see the user running it through top, but if we do PS aux space grep friend, so let's just do that.

There's parental controls right there, and you can see it's running on the guest user, which is my guest user's account when y...

More Articles

View All
Introduction to integral calculus | Accumulation and Riemann sums | AP Calculus AB | Khan Academy
So I have a curve here that represents ( y ) is equal to ( f(x) ), and there’s a classic problem that mathematicians have long thought about: how do we find the area under this curve, maybe under the curve and above the x-axis, and let’s say between two b…
Khan Academy view of mastery learning
The terms mastery learning are used a lot these days, but I want to do a video on them because they can mean different things to different people. I want to talk about what it means, at least in a Khan Academy context. So to give us some perspective, let…
Interesting example of Aliasing
Okay, I stuck a moment without the kids to do this for you. I’m going to show you a principle called aliasing. Aliasing is when your sample rate of your measuring device is not fast enough to actually catch the true frequency of what’s happening, so you c…
Lecture 8 - How to Get Started, Doing Things that Don't Scale, Press
Yeah, thanks for having me, Sam. Um, I’m Stanley. I’m the founder of DoorDash, and it’s really amazing to be here because it wasn’t actually that long ago where I sat in your seats. Um, I was class of 2014, graduated in CS, as well as my co-founder Andy. …
Modeling with multiple variables: Roller coaster | Modeling | Algebra II | Khan Academy
We’re told a roller coaster has c cars, each containing 20 seats, and it completes r rides a day. Assuming that no one can ride it more than once a day, the maximum number of people that can ride the roller coaster in a single day is p. Write an equation …
YENİ KAPSÜL ÇADIRIMIZLA KARDA KAMP
Özgür: There’s bear poop here. Burcu: Where? Özgür: Right behind us. Burcu: Those? Özgür: Yes. Burcu: Oh, it’s pretty big. Burcu: Looks great inside. Özgür: These are lightweight as well. Burcu: The air’s freezing up now. Özgür: Yeah. Burcu: It’…