Change file or directory permissions in Linux using numbers (three digits):
# chmod 777 /MyFolder
This method uses arithmetic, where it adds up the values of each permission to produce a final result composed of three digits:
u user | g group | o other | |
---|---|---|---|
r read = 4 | ✓ | ✓ | ✓ |
w write = 2 | ✓ | ✓ | |
x execute = 1 | ✓ | ||
4+2+1 = 7 | 4+2 = 6 | 4 |
- to give permissions rwxrw-r– use the following command:
# chmod 764 /MyFolder
Note: Linux chmod will interpret any numeric argument as octal, hence no leading zero is necessary.
Leave a Reply
Your email address will not be published. Required fields are marked *