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

Terminal Lesson 3


3m read
·Nov 3, 2024

Mack heads 101. Today we're going to show you how to use terminal. This is from Ana lesson three. We're going to show you how to change another user's password or your own password, how to shut down the computer, how to restart the computer.

So first of all, I'm gonna show you how to change a user's password. This is something you might find useful. We type passwd and hit enter while we're logged into our user to change the user we're currently logged into's password. If you don't want to do it, you press ctrl + C to cancel. While you're running passwd, you type your old password, hit enter, type your new password, hit enter, confirm your new password, then hit enter.

And I'm gonna press ctrl + C again. If you want to change another user's password, you do passwd username and that changes the other user's password. You have to get the old password right, by the way. If you're root and you do passwd username, it'll just ask you for the new password, so root can change any user's password very easily. It's sort of not good anyway, so that's cool.

Another thing is how to shut down the computer, and this is something that you need to be root to do. So we do sudo and then the commands I'm about to show you. I will remind you, if you're not an admin on a Mac, you will not be able to do sudo.

So let's get started here. We're gonna type sudo shutdown -h now, and what this is gonna do is it's gonna be root, it's gonna shut down the computer. -h means halt; that means it's gonna shut down the computer, halt it. And now is the time. Instead of now, if we type in military time, a time—so you know what military time is—instead of after noon it goes back to one. Instead of that, it goes to 13, 14, and midnight is zero o'clock.

Right now you can see it's five thirty-seven, so that's 17:37. If I make this command 1738, then it will shut down the computer in one minute. You know, give us a minute to press ctrl + C to cancel.

Also, instead of the -h, you can do -r to reboot the computer. And remember, now just means do it now. If you don't want to set a time for it, you can just do sudo reboot. Reboot is a command that just restarts the computer, and halt shuts down the computer.

Remember, you have to be root to shut down through a terminal on a Mac. Through the GUI, if you just press the power button and this comes up, when you click shut down, it acts as root for shutting down. And if you click restart, it acts as for restarting, and that’s how the GUI does it.

In the last time I was trying to do this, I accidentally halted my computer in the middle of the video, so I'm filming it again right here. So that's how to shut down the computer, that's how to restart the computer, and that's how to change another user's password.

So let's just do it one more time: sudo halt halts the computer, shuts it down; sudo reboot restarts the computer; and sudo shutdown -h now means shut down the computer now.

That's how to shut down and reboot, and how to change another user's password and how to change your own. Remember, passwd will change the current user's logged in password by default—not root's password. If you do passwd root, it'll change root's password.

You have to enter the old root password. If you do sudo passwd root, because if you're root, you can change someone's password, then you can change root's password very simply.

So that's how a few things today in terminal, and that's all I'm going to be showing you. Thank you for watching. Check in with Mac heads more often and subscribe. And yeah.

More Articles

View All
How to sell a $24,000,000 private jet.
He wants a 550 and a 450. He wants to spend the budget total amount for two aircraft, maybe 20 to 25 million range. 550, he said, instead of buying your 450 as a second aircraft, we might end up buying two 550s. Right? He just saw one of your ads. I beli…
Cannon Shock Waves in Ultra Slow Motion - Smarter Every Day 200
Hey, it’s me Destin. Welcome back to Smarter Everyday. Today, we’re in rural Tennessee for an actual artillery competition. And if you learn anything from this truck that’s coming up behind me, this is pretty legit. There’s dudes from all over the country…
Inside The $100,000,000 Empire Of Dhar Mann
What’s up, you guys? It’s Graham here, and today I’d like to introduce you to one of the most successful entrepreneurs you probably didn’t expect, Darman. At the age of 30, after nearly having to move back in with his parents, he developed a series of mot…
Help Jason Give Back to Khan Academy
My name is Jason Spiers, and at the age of 19, I made a stupid decision to sell cannabis and ended up in prison. Fortunately, my mother sent me Khan Academy transcripts to start improving my education, and while I was doing that, other inmates noticed and…
Conditional probability tree diagram example | Probability | AP Statistics | Khan Academy
Accompany screens job applicants for illegal drug use at a certain stage in their hiring process. The specific test they use has a false positive rate of 2% and a false negative rate of 1%. Suppose that 5% of all their applicants are actually using illega…
Adding and subtracting fractions with negatives | 7th grade | Khan Academy
Let’s say we wanted to figure out what (3 \frac{7}{3}) minus (-\frac{7}{3}) minus (\frac{11}{3}) is. Pause this video and see if you can have a go at it before we do it together. All right, now let’s work on this together. You might be tempted to deal wi…