That error is a gut punch, I know
You're in the middle of something, you type ls ~/Desktop or find /Users/you/Library, and Terminal just shrugs: Operation not permitted. Infuriating, right? The good news: it's not your files, it's macOS privacy guards. Let's fix it.
The fix: Grant Terminal Full Disk Access
This started with macOS Mojave (10.14) when Apple locked down user data. Terminal, like any app, needs explicit permission. There's no gray area—either you grant it or you keep hitting the wall.
- Open System Settings (or System Preferences on older macOS) from the Apple menu.
- Go to Privacy & Security → Full Disk Access.
- Click the lock icon and enter your password or use Touch ID.
- Click the + button, navigate to Utilities (press Cmd+Shift+G and type
/System/Applications/Utilities/Terminal.app). - Select Terminal and click Open. Make sure the toggle next to Terminal is on.
Now quit Terminal completely (Cmd+Q) and reopen it. Try your command again. It'll work—that's the whole fix.
Why this works
macOS uses a privacy framework called TCC (Transparency, Consent, and Control). It sits between apps and your personal data. When you grant Full Disk Access, Terminal gets the keys to protected folders like Desktop, Documents, Downloads, and certain Library subfolders. The error isn't a permission bit in the file system—it's an app-level gate. That's why chmod or sudo won't get you through. You need the GUI grant.
Less common variations
1. Terminal isn't in the list
If you don't see Terminal in the Full Disk Access list, click + and use Cmd+Shift+G to paste the full path. Some users have two Terminal copies (like iTerm2 or a portable build). Make sure you're granting access to the exact binary you run.
2. The error appears in a script or app, not Terminal
If you're running a shell script from Finder, that script is executed by Terminal or another shell—so grant access to the host app. If the script runs via cron or launchd, add the daemon's binary instead. For example, if you use Homebrew services, add /usr/local/bin/brew (or /opt/homebrew/bin/brew on Apple Silicon) to Full Disk Access.
3. You're using an older macOS (Catalina or earlier)
The steps are the same but the UI is System Preferences → Security & Privacy → Privacy tab → Full Disk Access. The lock icon is bottom-left. Same process, slightly different look.
4. Still stuck after granting access?
Restart your Mac. TCC sometimes caches permissions, and a reboot clears it. If that doesn't help, check if you're using a custom Terminal replacement like iTerm2—grant access to iTerm2 instead, not Terminal. Also, if you're in a corporate environment, a profile might be blocking changes. Look for a lock icon that won't unlock—that's a sign of MDM restrictions.
Prevention: Stop this from happening again
The easiest way to avoid this error is to grant Full Disk Access right after you install a fresh macOS or a new terminal app. Do it proactively, not reactively. When you're setting up a new Mac, add Terminal (and your package manager) to Full Disk Access before you start poking around in Library folders. Also, keep macOS updated—each update sometimes resets TCC permissions, so if you upgrade and the error returns, just re-add the app.
And if you're always getting this error with specific folders, check if those folders are in iCloud Drive. macOS treats iCloud-synced folders differently, and you might need to toggle iCloud Drive access under Files and Folders in Privacy settings. That's a separate permission but easily confused.
One more tip: don't disable System Integrity Protection (SIP) to work around this. It's not worth the security risk, and you'll be back to square one with a different set of errors. The Full Disk Access route is safer and takes two minutes.
That's it. Go fix that command and get back to your work.