Mac modify the new file, the default folder permissions

New Mac file and folder permissions of the current user default only read and write, others only read permissions

 

Mac modify the new file, the default permissions of a folder steps are as follows:

1. Open the "terminal"

2. Enter the command in the terminal:

sudo launchctl config user umask 002

 

When you create a file from the default value (for files, usually 666, for folders, usually 777) mask value is subtracted to determine the permissions of the new file or folder.

Mask value: 4 read, write 2 

For example, the default mask 022, 666-022 = 755 = 644,777-022, this setting will set permissions for the new file 644, and set permissions for the new folder 755. These permissions allow groups and other users read the file and open the folder, but only the owner can be changed.

 

Reference Links: https://support.apple.com/zh-cn/HT201684

3. Restart the Mac

 

Guess you like

Origin www.cnblogs.com/ElegantSmile/p/10955149.html