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

Prank Your Friends With Terminal (Update)


4m read
·Nov 3, 2024

Hey guys, this is Mack Heads. One-on-one with a remake of a video we made a long time ago about how to prank your friends with terminal. In that video, we showed you how to quickly do something in terminal that basically makes it so your friends can't open whatever application you want to make it so they can't open. It'll get frustrating and confusing, whatever.

So in the tutorial before, what we showed you didn't really work all the time, and people have been complaining that it doesn't work. So in this video, I'm going to be clearing things up, showing you how to do it in a better way that'll always work.

First of all, in order to do this, you're going to want to open up terminal. I have it in my dock; you can go into your apps folder and launch it. So this is terminal. The first thing we're going to do is type cd space desktop. Um, you can replace desktop with documents if you want to make it less apparent where you put the shell script. It doesn't really matter.

So let's go ahead. Once we're on our desktop, type nano space test.sh. You can call it anything as long as it has .sh at the end of its name.

Alright, so here's where we're going to type our code. So I'll type while space ( true ) space do and then here we're going to write kill all and then with a capital S, Safari. And then on the next line, type done.

So with the while true and done do, they make this code in here run again and again and again in an infinite loop. So it'll kill Safari again and again and again. What killing is, is basically it's the same thing as quitting. So when you quit Safari, it's the same thing as killing Safari; it's just like this is going to be automated. So Safari will keep on being killed pretty much instantly, again and again.

So let's press control x, hit Y, and hit enter. Now you'll see this file appear on our desktop; it's called test.sh. This is the program that we're going to be running through terminal.

Now what you can do, and this will not run once you click terminal, is write sh space test.sh. This will run it, and now if I try to open Safari, it won't open. As you can see, it just bounces in the dock. The thing is, let's say I go ahead and I quit terminal. I just did that by pressing command Q, and so I go back up and open Safari, and it works again.

So that's a problem; we don't want Safari to work. That's not what we want. So let's go ahead again, and I'll type cd desktop one more time, and we're going to be running this in a way that will run even once we quit terminal, and even if we log out and log back in, it'll still be running.

So what you want to do is write nohup space sh space test.sh space > /dev/null space &. This basically runs this in the background, and it will no longer be attached to the terminal process. So let's hit enter.

Alright, so let's go ahead and try to open up Safari, and it doesn't work. Now let's quit terminal. Let's go ahead and quit it, close, and Safari still doesn't open.

So at this point, you might be panicking because we've been doing this as I make the video, and you didn't watch ahead like you should, but you're probably panicking because how do I make this work? How do I get it so I can open Safari? Well, one way is to reboot, but that's a real pain in the butt.

So what an easier way is to go into terminal and type killall space sh. Just go ahead and hit enter, and now Safari will open again like new. So that is that.

Let's try some different processes. So let's cd back to my desktop in nano test.sh. Let's say we want to quit Google Chrome. Well, Google Chrome's process name is Google Chrome with a space. In order to put a space in a killall statement, we need to put it in quotes.

So we'll say killall space "Google Chrome". By the way, the process name which comes after the killall statement is case sensitive, and it's very important that you type it exactly as it is. So I'll have in the description the process names of a bunch of different apps. It's pretty easy to guess most of them for most apps.

But anyway, that's Google Chrome. So let's press control x, hit Y, and hit enter. Now let's type the command that we did before, the nohup to run that. And now, as you can see, I can't run Google Chrome. Fantastic!

Let's killall sh, and it's done. Now we don't have to worry about Google Chrome being open.

So that is how it is done correctly, so that way you can run this in the background, and they won't be able to stop it without typing that in terminal. So in the description, I'm going to link to download all of these codes and I'll have some process names for some different applications, so that way you can try this out for different apps.

One more important thing that I want to show you guys before I finish off this video is how to make it use less CPU because you might notice if you run this for a little while, your fan on your computer will start going crazy, and that's because it uses a lot of CPU.

So let me show you how to fix this. Let me go back into editing it before the done. We're going to add another line that says sleep space 0.2. Okay, and I'll press control x, Y, enter.

And now if I run this—whoops! Now if I run this, it'll use a lot less CPU because there's a little delay between each time that it kills Chrome. So maybe you'll see a flicker, but it uses a lot less CPU when it's running in the background.

So let's killall sh one more time, and it's all good. So thanks for watching. Mack Heads will unsubscribe, and goodbye.

More Articles

View All
Looking at Nat Turner's Legacy | Explorer
I was ordained for some great purpose in the hands of the Almighty. Nat Turner was an enslaved African American preacher who was born in 1800 and led a large-scale rebellion in 1831 that transformed the system of slavery. He chose violence as his only opt…
shower thoughts that really confuse me..
Wow, another shower thoughts video; who would have guessed? Not like the last two got a million views or anything. Look, I’m just trying to make people smile or something. You know, people say that a child’s laughter can light up your home, unless it’s 3:…
Analyzing mistakes when finding extrema example 2 | AP Calculus AB | Khan Academy
Aaron was asked to find if f of x is equal to x squared minus 1 to the 2⁄3 power has a relative maximum. This is her solution, and then they give us her steps, and at the end, they say, is Aaron’s work correct? If not, what’s her mistake? So pause this vi…
Exploding Weed Seeds (28,546 fps Slow Motion)- Smarter Every Day 257
A portion of this video is sponsored by Google. More on that later. Here on Smarter Every Day, I like to explore things, and I like to figure them out for myself. And there’s one thing that you can do with the internet that’s really cool: you can just go …
The Nurse Keeping Explorers Alive | Podcast | Overheard at National Geographic
Foreign. This is a National Geographic map of the world. We’re in a basement office at National Geographic headquarters, and Karen Berry is standing in front of a huge map that stretches from floor to ceiling. Like a military general, she points out explo…
Underwater Cave Diving: Choosing Passion Over Risk | Nat Geo Live
Kenny: I think there’s been a big trend in expeditions that are geared towards science that’s also geared towards conservation. I can rationalize, you know, why I take risks for scientific reasons, for conservation reasons. But, I would be lying to you. I…