MacOS – Why is ‘/opt’ hidden, and what can I do to unhide it

findermacos

On my ML MBP, '/opt' is somehow 'hidden'. In the finder, it shows in gray. In various applications, it's invisible from a file selection dialog box. Get Info and ls -l show now flags that corresponds to this behavior. Is there any way to turn it off?

Best Answer

Out of the box, there is no /opt file delivered by OS X.

This command will show the hidden status of files in root ls -lO / with O being the capital letter, not zero. The chflags command can be used to toggle the hidden flag if needed.

Depending on how you got /opt created, you may or may not have issues with the permissions changing again - most tools leave things alone with respect to filesystem flags as long as the read/write/execute permissions are not removed.