ls: .: Operation Not Permitted

Seeing “ls: .: operation not permitted” in Terminal? It means macOS is blocking access to a protected file or folder—and it’s usually a quick fix. MacKeeper’s Premium Services bundle cleanup, security, and optimization tools with 24/7 expert support, so you’re never stuck.

System Requirements: macOS 10.11 or later

More than 60 Million Downloads

i

AV-TEST certified

i

Notarized by Apple

i

AV-TEST is an independent lab that checks the effectiveness of antivirus apps against real malware samples.

The notarization by Apple is a security measure to check if software is free from malicious components.

Trustpilot is an independent digital platform that hosts insightful and honest consumer reviews.

ls: .: Operation Not Permitted
Written By   Yana Khodun
Published: July 22, 2026

What does “ls: .: operation not permitted” mean on Mac?

“ls: .: operation not permitted” means Terminal doesn’t have permission to look inside the file or directory you asked about. macOS guards certain areas of every Macintosh, and when an app tries to access without the right access, you’ll see the error every time instead of a result. In short, the system has denied Terminal what it needs.

 

Two security layers are usually behind it. Full Disk Access controls which apps can reach protected folders, while System Integrity Protection (SIP) shields core system files from changes. Both are simply doing their job—keeping your data safe—even when they get in your way.

 

If your window looks cluttered while you troubleshoot, a clear Terminal command on Mac tidies things up, making each message easier to read.

How to fix the “operation not permitted” error on Mac?

There’s no single switch here—the right approach depends on what’s blocking access. Most of the time, it comes down to permissions or system settings, both shaped by the security features of macOS that protect your machine.

 

In most cases, the culprit is one of a few things—Terminal lacking disk access, a locked file or folder, a restricted directory you’ve wandered into, settings that haven’t refreshed yet, or SIP guarding core files. Enabling full disk access, adjusting permissions, switching to a user directory, restarting, or briefly disabling SIP each tackles one of those causes.

 

If you’re running a Unix command and the issue is related to file permissions, you can also try running the command with administrator privileges using sudo.

A note from our experts: 

 

As you can guess already, it’s not always easy to determine the cause behind the “ls: .: operation not permitted” issue from the first attempt. To support you on the way, we suggest contacting our Premium Services within the MacKeeper app and getting professional help with both identifying the issue and finding a solution. 

 

To try our support service, do the following:

  1. Download and install MacKeeper on your Mac.
  2. Find the Premium Services feature and click the Chat Now button.
  3. Use the text box to explain your issue, then try our specific advice.
MacKeeper's Premium Services window on macOS showing the Premium Services tab and a free-checkup panel to fix the operation not permitted error.

We’ve lined up the methods that work most often below, so start at the top and work your way down.

1. Enable Full Disk Access for Terminal

Granting Full Disk Access lets Terminal read the protected directories it’s currently locked out of, which clears the error in many cases. It’s the first thing we reach for.

 

Here’s how to turn it on:

  1. Open the Apple menu and choose System Settings.
  2. Click Privacy & Security, then select Full Disk Access.
  3. Switch on the toggle next to Terminal. If it isn’t listed, click the Add button (+) and pick it from Utilities.
  4. Quit and reopen Terminal so the change takes effect.
Apple menu open on a MacBook with System Settings highlighted, the first step to enable Full Disk Access for Terminal on macOS.
Step 1. Go to Apple Logo > System Settings
macOS System Settings window with Privacy & Security selected and Full Disk Access highlighted to grant Terminal disk access on a Mac.
Step 2. Go to Privacy and Security > Full Disk Access
Full Disk Access pane in Apple's System Settings with the Add (+) button highlighted to list Terminal on your Apple computer.
Step 3. If Terminal isn’t listed, click the Add button (+)
Finder Applications window on macOS browsing Utilities to pick Terminal, with the Open button ready to add it to Full Disk Access.
Step 4. Pick Terminal from Applications > Utilities > Terminal
Full Disk Access list in System Settings on a MacBook with the toggle next to Terminal switched on to grant full disk access.
Step 5. Switch on the toggle next to Terminal
Terminal menu open on an Apple laptop with Quit Terminal highlighted, quitting the app so the Full Disk Access change takes effect.
Step 6. Quit and Reopen Terminal

2. Check file and folder permissions

Sometimes the block isn’t system-wide—a single file or folder simply has access rights that shut you out. You can review and adjust those rights from Finder in a few clicks.

 

Follow these steps:

  1. Select the file or folder in Finder, then press Command-I to open Get Info.
  2. Scroll down to Sharing & Permissions at the bottom of the window.
  3. Click the lock icon and enter your password to allow changes.
  4. Set your account’s privilege to Read & Write, then quit and reopen Terminal.
Finder Documents window on macOS with a PDF file selected and the Finder Dock icon highlighted before opening Get Info permissions.
Step 1. Select the file or folder in Finder
Apple keyboard with the Command and I keys highlighted, the shortcut that opens Get Info to check file and folder permissions on a Mac.
Step 2. Press Command-I to open Get Info
Finder Get Info window for a PDF on macOS with the Sharing & Permissions section highlighted to review file access rights.
Step 3. Go to Sharing and Permissions
Get Info Sharing & Permissions pane on a MacBook with the lock icon highlighted, unlocking the file permissions to allow changes.
Step 4. Click the lock icon
Finder password prompt on macOS asking for your password to change permissions, letting you edit the file's access rights on a Mac.
Step 5. Enter your password to allow changes
Get Info Sharing & Permissions on an Apple computer setting your account privilege to Read & Write to clear the permission block.
Step 6. Set your account’s privilege to Read & Write

3. Make sure you’re working in the correct directory

It’s not a real solution to your problem, but a necessary checkup to be done, as our practice shows that it’s easy to land in a folder macOS keeps off-limits without realizing it. If the error only shows up in certain spots, the directory itself may be the culprit—not your permissions.  

 

Follow our guidelines below:

  1. Type pwd in Terminal and press Return to see which directory you’re in.
  2. If it’s a protected system folder, head somewhere user-friendly—your Home or Documents folder works well.
  3. Run cd ~/Documents to switch there, then try your command again.
Terminal window on macOS running the pwd command, showing the current directory is the protected /Library/Application Support folder.
Step 1. Type pwd in Terminal and press Return to see which directory you’re in
Terminal on a MacBook typing cd ~/Documents to switch out of a restricted directory into the user-friendly Documents folder.
Step 2. Run cd ~/Documents to head user-friendly folder
Terminal window on macOS after pwd confirms you are now in /Users/oliverfabregas/Documents, a safe user directory on the Mac.
Step 3. Type again pwd in Terminal to see which directory you’re in
Terminal on an Apple laptop running ls in the Documents folder, listing a PDF successfully with no operation not permitted error.
Step 4. Check if command ls work

4. Restart Terminal or your Mac

Permission changes don’t always kick in right away. Quitting Terminal usually helps, and when it doesn’t, you may need to restart Mac so those settings load properly and any temporary glitch clears out.

 

Here’s the quick version from us:

  1. Press Control-C to stop any running command, then quit Terminal with Command-Q.
  2. Reopen Terminal and run your command once more.
  3. Still stuck? Restart your Mac from the Apple menu ▸ Restart, then test again.
Apple keyboard with the Control and C keys highlighted, the shortcut to stop any running command in Terminal before restarting.
Step 1. Press Control-C to stop any running command
Apple keyboard with the Command and Q keys highlighted, the shortcut used to quit Terminal so permission changes reload on a Mac.
Step 2.  Press Command-Q to quit Terminal
Apple menu open on macOS with Restart highlighted, restarting the Mac so pending permission and settings changes load properly.
Step 3. If it still doesn't work, restart your Mac  

5. Temporarily disable System Integrity Protection (advanced)

This one’s for stubborn cases only. System Integrity Protection (SIP) is a core protection layer that stops even administrators from changing protected system files. Turning it off can lift the block, but it leaves your Mac more exposed—so treat it as a last resort and switch it back on as soon as you’re done.

 

Here’s the process, and please go slowly:

  1. Restart your Mac and hold the power button (Apple Silicon) or Command-R (Intel) to enter Recovery Mode.
  2. Open Utilities ▸ Terminal from the menu bar.
  3. Type csrutil disable and press Return.
  4. Restart, make your change, then return to Recovery Mode and run csrutil enable to switch protection back on.
Illustrated guide to enter Recovery Mode on a Mac, showing Apple silicon power-button and Intel Command-R steps to disable SIP.
Step 1. Enter Recovery Mode
macOS Tahoe Recovery Mode with the Utilities menu open and Terminal selected, next to the Install macOS Tahoe recovery options.
Step 2. Go to Utilities and select Terminal
Recovery Mode Terminal on macOS Tahoe with the csrutil disable command typed to turn off System Integrity Protection on the Mac.
Step 3. Type csrutil disable and press Return
Recovery Terminal on macOS Tahoe confirming System Integrity Protection was successfully disabled and asking to restart the Mac.
Step 4. Check Result
macOS Tahoe Recovery Apple menu with Restart highlighted to reboot the Mac after disabling SIP and applying your system change.
Step 5. Restart Mac from Apple Logo or run the reboot command in Terminal

Can you permanently disable protections to bypass “ls: .: operation not permitted”?

Technically, yes—you can leave SIP off. But we don’t recommend it. With that protection gone, malware and unwanted apps can reach the very system files macOS works hard to guard, and a single bad install could do real harm.

 

Think of SIP as a seatbelt. You can unbuckle it for a moment if you truly need to, but riding around without it isn’t worth the gamble. Re-enable protection as soon as your task is finished, and you’ll keep your Mac on safe footing.

 

You might also run into “ls: .: operation not permitted” inside a Docker container, where the same permission rules apply—another reason to keep your system’s defenses intact.

What to do if “ls: .: operation not permitted” keeps appearing?

If the error sticks around after every method above, something deeper may be going on. Don’t worry—a few broader checks usually sort it out, whether you’re on a MacBook, an iMac, or a Mac mini. We recommend doing the following:

  • Revisit System Settings ▸ Privacy & Security to confirm Terminal still has the access you granted.
  • Think back to any recent changes—a new app, a system update, or a tweaked setting can quietly reset permissions.
  • As a final step, back up your files and reinstall macOS to give the machine a clean slate. A clean reinstall sounds drastic, but it’s a reliable way to clear lingering permission issues without losing your data when you’ve backed up first.

Conclusion

Nearly every time, “ls: .: operation not permitted” comes down to permissions—macOS simply protecting a file or folder behind its security layers. Grant Terminal the right access, double-check your directory, and the message usually disappears.

 

If you’d rather not manage all this by hand, MacKeeper’s Premium Services keep your Mac clean, secure, and running smoothly, with a 24/7 Help Center ready whenever a question pops up. Let our team handle the heavy lifting!

Use your Mac to the fullest! Sign up and get:
Effective tips on how to fix Mac issues
Reliable advice on how to stay safe online
Mac-world news and updates

Thank you!

You’ll love exploring your Mac with us.

Oops, something went wrong.

Try again or reload a page.

Here’s another sign you need to upgrade your macOS ASAP:

30% off your MacKeeper subscription

Сopy the code now and use it in the MacKeeper checkout after the upgrade.

Copy Code

Please be aware that this code cannot be combined with any other discounts, offers, or promotions.

Contents

Unlocked
PC

MacKeeper - your all-in-one solution for more space and maximum security.

Try Now

Read more

macOS Tahoe Freezing when Saving Files
macOS Tahoe Freezing when Saving Files
Function Keys Not Working Mac
Function Keys Not Working Mac
arrow

Run Application

step_1

Click Continue

step_2

Click Install

step_1

Your macOS version is lower than OS 10.11. We’d like to offer you MacKeeper 4 to solve the cleaning, privacy, and security issues of your macOS.