Change Folder Permissions Command Line Terminal Mac X

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.

Change Directory Terminal Mac

4.     Now that we are in the folder we want, type ls –l to reveal all sub files and folders and their permissions.

CHMOD Mac Terminal LS Command

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

CHMOD 755 Mac Terminal
* Please use the comment form below. Comments are moderated.*



Related Posts

 

Comments 2

urzh on Sunday, 11 February 2018 10:40

Thank you! We made the correction.

Thank you! We made the correction.
Guest - dave on Sunday, 11 February 2018 09:46

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

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
Thursday, 19 December 2024