Several users have reported that they are unable to use Terminal to execute commands because they see an error message saying “Operation not permitted”. This article explains how you can fix this problem.
Terminal lets you have text-based access to the macOS operating system. This can make it easier for you to manage and control your computer.
Operation not Permitted error fix
1. Open System Preferences and Security & Privacy.
2. Click the Privacy tab.
3. Click Full Disk Access on the left. And click the Lock icon at the bottom left of the pane (if it is locked) and enter your password so that you can make changes.
4. Select Terminal so that it is allowed to access “Full Disk Access”.
5. A popup will appear saying “Terminal will not have full disk access until it is quit. You can choose to quit Terminal now, or do it on your own later.” Click Quit & Reopen.
6. Terminal will open. Run your command again. This time it will work.
If this does not work for you, you may want to turn off System Integrity Protection (the SIP). If you do this, disable it temporarily and turn it back on after you are done.