This course has been updated! We now recommend you take the Full Stack for Front-End Engineers, v2 course.
Transcript from the "Changing permissions" Lesson
>> Jem Young: Okay, so we all have a www directory. So, you know, I had to keep sudoing when I wanna make a file. I don't wanna do that anymore. So, I'm gonna chown something, so, chown stands for change of owner. And I'm just gonna change that into donor to be me.
[00:00:17] In this case, this particular case $user is dash shorthand for your current user. It's not a placeholder. So,
>> Jem Young: I'm going to chown the www directory to myself. So sudo,
>> Jem Young: chown -R for recursive, and $USER is me. And the group is also me. You don't have to do the group, it's just a good habit.
[00:00:49] And I wanna change the ownership of the www directory to myself.
>> Speaker 2: So does root on it now? And we're changing it to our ownership.
>> Jem Young: Exactly, so currently now I own it. So now I can make directory tmp2, and it won't as me to sudo it anymore.
[00:01:06] So that's useful. Permissions is a whole nother two hour lesson, but don't overdo permissions, don't change things just because it makes it easier on yourself. If something's owned by sudo, leave it owned by sudo until you understand exactly what's happening. Stupid story of my own, I was trying to globally install an MPM module.
[00:01:28] But I don't own /user/local, it's owned by sudo. So I was like, I'll just change ownership to me. So I changed the ownership to me, and then it just broke the entire computer, cuz sudo couldn't get in anymore. It didn't work properly, and I locked myself out, and I had to delete the entire server and start over.
[00:01:43] So anyways, moral of the story is, don't change ownership unless you really really need to. But in this case, since we're gonna be writing a lot, and we don't want to sudo every single time, it's better to change ownership to yourself. So let me just remove,
>> Jem Young: Is it RAM 3 or is it Windows?
>> Jem Young: Tmp star, cool. If you want to remove things that are named similarly, so let's make mkdir tmp, mkdir tmp2. If I want to remove multiple things, I can say rmdir tmp*, and it's gonna remove everything that starts with tmp. It's just a fast way of moving a bunch of files that are named similarly.
[00:02:24] It's good for cleaning up log files, or something where you know what the file name starts with. So I can also say rm -rf tmp *, and it'd do something similar.
>> Jem Young: See now we're getting into the good, fun command-line stuff. And I'll just keep throwing random tips out there.