Change Folder Permissions Command Line Terminal Mac X
Let’s review the types of permissions you can choose from in Mac X and Unix
Permissions |
None |
Execute |
Write |
Write and execute |
Read |
Read and execute |
Read and write |
Read, write and execute |
Octal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Symbolic |
--- |
--x |
-w- |
-wx |
r-- |
r-x |
rw- |
rwx |
In Mac X Terminal, you will use octal notation to set permissions as needed.
It is important to note that Mac X 10.11 by default sets permissions to limit the logged in user to access to file and system directories. If something requires you to specify octal notation on a file folder, you do so using Mac X Terminal. Let’s get started.
1. Open Mac X Terminal
2. Let’s get into the directory of files we want to change permissions to. In this example, we change directory to /opt/X11
3. Type cd into Terminal and drag the folder or file(s) you want to change permissions on by dragging it into Terminal window. This is an easy way to the path to copy into Terminal without having to type it.
4. Now that we are in the folder we want, type ls –l to reveal all sub files and folders and their permissions.
5. To change permissions on any folder or file type: chmod 01234567 and path file folder.
6. Example: chmod 755 /bin which gives bin folder Read/Write/Excute or rwxr-xr-x
* Please use the comment form below. Comments are moderated.*
Comments 2
Thank you! We made the correction.
Thanks for your help. I have noted a small typo. Line 4, you need to remove the first "-" symbol. i.e. "-ls-l" should be "ls -l". Regards