I did try to gunzip a folder in usr/local/
/usr/local/
but it says permission denied.
/usr/local/
is a protected directory in macOS. The observed behaviour in your case is due to System Integrity Protection. SIP does not allow even the root user or using sudo to chown
/usr/local/
.
As per man hier
, /usr/local/
is the recommended directory for placing executables, libraries, etc. not included by the basic operating system. So it is where you should be installing your software (from source). The approach to take here is to create a directory under /usr/local
and chown
it to logged in user. This new directory can be used to install new software as per your liking.
/Users/
houses the users home directories, along with a Shared directory, shared between users. So, this is not the place to install new software, whether from source or not.
You can also refer to this nicely written answer discussing Standard for macOS filesystem.