Granular Permission Changes
Symbolic notation allows you to add or remove specific permissions without knowing the current state, using symbols for the affected parties and actions.
Symbolic Components
- Who:
u(user/owner),g(group),o(others),a(all: ugo). - Action:
+(add permission),-(remove permission),=(set permission exactly). - Permission:
r,w,x.
Examples
-
Add execute permission to the owner (user): bash $ chmod u+x my_script.sh
-
Remove write permission from the group and others: bash $ chmod go-w sensitive_file.txt
-
Set the permissions for everyone exactly to read-write: bash $ chmod a=rw private_data
Best Practice: Use Symbolic notation (u+x) when you want to make a small, precise change. Use Octal notation (755) when setting the permissions from scratch.