0

Mac 10.11.5 (El Capitan) here. I just tried creating a directory under /opt:

myUser$ mkdir /opt/bupo
mkdir: /opt/bupo: Permission denied

Why would I need to prefix this with sudo and then authenticate myself in order for this command to work? If I were to use sudo mkdir /opt/bupo, then what user would actually be creating + owning this bupo/ directory, would it be root?

2

Only the root user can write to the root of the file system. So, it is safe to assume that the /opt directory is owned by root. The default umask would make that directory read, write, and executable to the owner; read and executable to the group; read and executable to others/everyone.

If you use sudo mkdir /opt/bupo the directory would be owned by the root user.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.