Learning machine learning? Try my machine learning flashcards or Machine Learning with Python Cookbook.
Change Permissions
To change the permissions of a file or directory we use the chmod
command. chmod
takes three digits, each one representing the permissions for the user, group, and everyone. Thus, 741
would mean:
- The user can read, write, and execute (
7
) - The group can read only (
4
) - Everyone can execute (
1
)
Here is a handy list translating the octal numbering system to permissions:
0
- no permission1
- execute2
- write3
- write and execute4
- read5
- read and execute6
- read and write7
- read, write, and execute
Create File
touch company_data.csv
View File Permissions
ls -l company_data.csv
-rw-rw-r-- 1 chris chris 0 Jul 29 12:55 company_data.csv
Change File Permissions
chmod 600
means the user can read and write, but the group and everyone else has no permission.
chmod 600 company_data.csv
View File Permissions
ls -l company_data.csv
-rw------- 1 chris chris 0 Jul 29 12:55 company_data.csv