Understanding Permissions
Linux is a multi-user operating system. This means that many people can use the system at once, but they shouldn't necessarily be able to see or modify each other's files.
The 3 Permissions
- r (Read): You can view the contents of the file.
- w (Write): You can modify or delete the file.
- x (Execute): You can run the file as a program or script.
The 3 Categories of Users
- User (Owner): The person who created the file.
- Group: A collection of users who share access to the file.
- Others (World): Everyone else on the system.
Reading the Permissions Output
When you run ls -l, the first 10 characters tell you about the permissions:
Example: -rwxr-xr-- 1. The first character indicates the type (- is a file, d is a directory).
2. The next 3 characters are for the Owner (rwx).
3. The next 3 characters are for the Group (r-x).
4. The last 3 characters are for Others (r--).
The Table of Permissions
| Symbol | Meaning | Numeric Value |
|---|---|---|
| r | Read | 4 |
| w | Write | 2 |
| x | Execute | 1 |
| - | No permission | 0 |