Unit 2 · Basic Commands · Lesson 18 of 34
Files Have Owners?!
Files Have Owners Too
Now that we’ve gone over users and groups, you’re ready to know a secret…
Every single file you create actually has two labels stamped on it behind the scenes!
- Owner → whoever created the file (you)
- Group → your personal matching group (again, you, just wearing a different hat)
Run touch notes.txt and behind the scenes, that file ends up looking like this:
owner: karl
group: karl
This only gets interesting once other people are involved. Say you and a friend are both added to a shared group called cyberacad. If a file's group gets changed to cyberacad, your friend can now access that file based on whatever the group permissions allow, even though they're not the owner and it's not "their" personal group.
So really, permissions always boil down to three questions about a file:
- Owner: can the one person who made it access it?
- Group: can people sharing that group access it?
- Everyone else: can literally anyone else on the system access it?
We’ll elaborate more when we cover ls -l in the next lesson!
Do this lesson for real
With a free account you get the terminal, the challenges and the checks that go with every lesson in Intro to Linux, and your progress is saved as you go. CyberAcad is a 501(c)(3) nonprofit, so there is nothing to pay.