This is a short blog post about assigning read/write permissions for all users to unpacked "custom model files and folders".
Here is an example of an unpacked model archive with files and folders.
cd ensemble_model
ls -l
- Example output:
drwxrwx--- 4 thomassuedbroecker staff 128 3 Feb 20:59 cnn_model
-rw-rw---- 1 thomassuedbroecker staff 685 3 Feb 20:59 config.yml
drwxrwx--- 3 thomassuedbroecker staff 96 3 Feb 20:59 ensemble_model
drwxrwx--- 4 thomassuedbroecker staff 128 3 Feb 20:59 stopwords
drwxrwx--- 3 thomassuedbroecker staff 96 3 Feb 20:59 syntax_model
drwxrwx--- 4 thomassuedbroecker staff 128 3 Feb 20:59 tf_idf_model
drwxrwx--- 4 thomassuedbroecker staff 128 3 Feb 20:59 tf_idf_svm_model
drwxrwx--- 4 thomassuedbroecker staff 128 3 Feb 20:59 use_model
drwxrwx--- 4 thomassuedbroecker staff 128 3 Feb 20:59 use_svm_model
The following tables provide a brief overview of how to interpret the above content.
- Table of access rights permissions (rwx).
| Type | read | write | execution | No Permission |
|---|---|---|---|---|
| Numerical | 4 | 2 | 1 | 0 |
| Letters | r | w | x | – |
- Table of types
| Type | Letters |
|---|---|
| Folder | d |
| File | – |
drwxrwx--- 4 thomassuedbroecker staff 128 3 Feb 20:59 use_svm_model
[-][-][-] [-----------------] [---] [---]
| | | | | |
| | | | | +-------- Size of the directory
| | | | +-----------> Group
| | | +-------------------> Owner
| | |
| | +---- All users rights
| +----- Group rights
+----- Owner rights
We will use the chmod command to change the permission.
| Parmeter | Permission |
|---|---|
| u+ | user permissions |
| g+ | group permissions |
| a+ | all users permissions |
| -R | recursive |
sudo chmod -R a+rw- .
| |||
| ||+----- assign no execution permission
| |+----- assign write permission
| +----- assign read permission
+------ assign all users permissions
- Example result:
ls
total 8
drwxrwxrw- 4 thomassuedbroecker staff 128 3 Feb 20:59 cnn_model
-rw-rw-rw- 1 thomassuedbroecker staff 685 3 Feb 20:59 config.yml
drwxrwxrw- 3 thomassuedbroecker staff 96 3 Feb 20:59 ensemble_model
drwxrwxrw- 4 thomassuedbroecker staff 128 3 Feb 20:59 stopwords
drwxrwxrw- 3 thomassuedbroecker staff 96 3 Feb 20:59 syntax_model
drwxrwxrw- 4 thomassuedbroecker staff 128 3 Feb 20:59 tf_idf_model
drwxrwxrw- 4 thomassuedbroecker staff 128 3 Feb 20:59 tf_idf_svm_model
drwxrwxrw- 4 thomassuedbroecker staff 128 3 Feb 20:59 use_model
drwxrwxrw- 4 thomassuedbroecker staff 128 3 Feb 20:59 use_svm_model

Leave a comment