Never really understood what was going on with Linux File Permissions and
If you understand binary then this will be a piece of cake. Here is a simple blog post to demystify Unix File Permissions:
-rwxr-xr-- 1 dgerman staff 823 Dec 16 15:03 findPhoneNumbers.sh
- r – Read
- w – Write
- x – Execute
Now why are there 3 sets of rwx?
- User – The owner of the file
- Group – The group owning the file
- Others (Rest of the World) – anyone
Below is a table Showing numeric permissions.
|7||read, write and execute||111|
|6||read and write||110|
|5||read and execute||101|
|3||write and execute||011|
When you give a 777 permission to a file/folder, you are giving user, group and anyone ((20 x 1 + (21 x 1 + 22 x 1)) = 7. That is Read, write and Execute.