PinSetDownload free

Terminal says "Operation not permitted" on your Mac

Quick answer

Turn on Terminal in System Settings > Privacy & Security > Full Disk Access, then quit Terminal with Command-Q and open it again. The same command should now work.

Why it happens

macOS protects private places such as Mail, Messages, Safari data and other apps' folders. Terminal can't read or change them until you give it Full Disk Access, and sudo doesn't get around that, which is why you see Operation not permitted. Terminal only picks up the new permission after it restarts.

How to fix it

  1. Open the Apple menu, choose System Settings, click Privacy & Security, then click Full Disk Access.

  2. Find Terminal in the list and turn its switch on. Your Mac asks for your password or Touch ID to confirm.

    Privacy & Security›Full Disk Access

  3. Terminal not in the list? Click the add (+) button below the list, open Applications, then Utilities, choose Terminal and click Open. Then turn its switch on.

  4. Quit Terminal completely with Command-Q, open it again and run your command once more.

Still not fixed?

  1. Using a different terminal app, or the terminal inside a code editor? The permission belongs to the app you type in, so add that app to Full Disk Access instead and restart it.

  2. If the error comes when changing or removing an app in the Applications folder, Terminal also needs App Management. Turn Terminal on there too, then restart Terminal.

    Privacy & Security›App Management

  3. Some places, like the System folder, are locked by macOS on purpose and stay read-only even with Full Disk Access. That's normal, and it protects your Mac from damage.

  4. If the switch is greyed out, a school or company may manage your Mac. Ask whoever set it up.

  5. If Terminal still says Operation not permitted in your own home folder with Full Disk Access on, restart your Mac and try again. If it keeps happening, contact Apple Support.

Questions people ask

Why does sudo say Operation not permitted on a Mac?

sudo gives admin rights, but privacy protection is separate. Terminal itself needs Full Disk Access in Privacy & Security.

How do I give Terminal Full Disk Access?

Open System Settings > Privacy & Security > Full Disk Access, turn on Terminal or add it with the + button, then quit and reopen Terminal.

Is it safe to give Terminal Full Disk Access?

It's fine if you know what you're running. Any command you type can then reach your private files, so turn it off again when you're done if you prefer.

Did this fix it?

Glad it worked.

Sorry it didn't. Tell us what happened and we'll fix this page.

Email hello@getpinset.com

Get there in one click with PinSet.

Press ⌃ ⌥ Space and type “zsh operation not permitted”. PinSet opens Privacy & Security › Full Disk Access in System Settings and rings Terminal. One of 2,400+ checked Mac fixes. Works offline.

7 fixes free · Works offline · macOS 26 and 27