It’s quite common for people to encounter a variety of errors while using Mac OS, with “ls: .: operation not permitted” being a prime example. This error does appear from time to time for a variety of users. So it makes sense to narrow down why it appears, what causes that error in the first place and how you can manage it appropriately.
Why does “ls: .: operation not permitted” appear?
The error shows that you don’t have the privilege to access any protected directories and files on your device. It will appear if you upgraded your system recently, since there might be a change in the security measures. A lot of the time, this should be an easy fix, although it might require different changes based on the OS version and the apps that you are using. But thankfully, there are fixes, so that’s important to keep in mind.
Enable full disk access
A very good idea is to enable full disk access for the different apps you plan on using. If you enter Privacy and Security in the System Settings, you will be able to find the Terminal in that list, or any other app, and you can offer or disable full disk access. Whenever you do these changes, you must share your admin password, and that is a crucial part of the process.
Adjust the file permissions
Adjusting permissions is also one of the ways to fix this problem. First, you must locate the file that you are trying to alter within Finder. After you find it, you right click on the File icon and then press Get Info. In there, under Sharing and Permission, select your username and change the privilege to read and write. That’s when you will be able to avoid the error, so it’s a very good idea to go through this step where possible, as it will be extremely useful.
Do some general maintenance
If you were wondering how to fix the “ls: .: operation not permitted” error, a lot of the time, maintenance is the best idea. Yes, using a Mac cleanup tool to help you improve performance, handle background and login items, removing temporary files, all of that will help. And you will unlock a great performance boost most of the time. Plus, errors like the ones shown above are amazing, and you will be quite excited to see how it all comes together. That’s why we think it’s a very good idea to perform general maintenance here and there, as it could be the best way to solve these problems.
Temporarily disable the system integrity protection or SIP
If you still have this issue, disable SIP on your Mac. The system integrity protection will protect your Mac from unauthorized code. A lot of the developers turn this feature off, in order to fix bugs, add new Mac OS extensions, or test code. But the truth is that having it on can be a problem, and this error might appear. A good rule of thumb is to disable it temporarily from your Terminal with the command “csrutil disable” and then restart your device.
What Mac OS versions are affected?
It depends, but a lot of the time it appears on the Mac OS versions that have SIP added to Mac OS, so those after 2015. If you have a Mac OS version newer than the 2015 one, you will most likely have this issue. Thankfully, there are ways to solve it, as we mentioned above, but it can get problematic if you have no idea what generates this problem and how you can fix it properly.
Is there a difference between permissions denied and seeing this operation not permitted error? Yes, because permissions denied means you don’t have permissions to perform an action. But when you see that the operation is not permitted, that means the system is not allowing you to run a command. You can fix that by granting full disk access to the terminal, or maybe you can disable the SIP. It’s great, and it has the potential to help more than expected if you follow the guidelines above.
Conclusion
It’s clear that dealing with this error is going to be quite the issue, especially if you want to access specific files. The truth is that all of these tips shown above can be handy, and they will help you save quite a bit of time and effort. Because at the end of the day, what matters is the overall experience, consistency and quality. Yes, there will be downsides, but at the same time, you always want to avoid any rush and focus on solving this problem fast. Because once you do, you can avoid dealing with issues when running commands, among many others.