Recently when I tried to run ls command in the Mac Terminal Zsh shell on macOS Big Sur, I got the below error,
code2care@mac % ls
ls: .: Operation not permitted
This was really weird, I was able to fix this issue by following the below steps,
- Click on the Apple logo on Menu Bar,
- Select System Preferences...
- Click on Security & Privacy,
- Select Files & Folders,
- Under - Allow the Apps below to access files & folders, look for terminal and check - Desktop Folder, you will get the below alert,
"Terminal” will not have access to files on your desktop until it is quit.
You can choose to quit “Terminal” now or do it on your own later. - Click on Quit & Reopen
- You will not be able to access ls and other commands on the desktop.

Security and Privacy Option

Select Desktop folder from Files and Folders
✏️ You can get such an error while trying to access Network volumes, Download, or Documents folder if the option in Files and Folders is unchecked for Terminal.
More Posts related to MacOS,
- Opening mac Terminal
- How to change default macOS Terminal Window size
- How to clear Mac Terminal screen
- Find Hostname of Mac running on macOS Ventura 13
- Installing MongoDB on Linux/Unix/macOS/Ubuntu
- How to switch from bash to zsh shell in macOS Terminal
- Limit scrollback rows in macOS Terminal
- How to Set Background Wallpaper on macOS 13 Ventura
- This operation couldnt be completed. Unable to locate a Java Runtime. [macOS]
- Encode or Decode Base64 String using Mac Terminal Command
- List of All Apple Silicon ARM Based M1/M2 Mac [updated Oct 2022)
- How to remove Siri from Menu Bar [macOS Big Sur]
- Must Know Homebrew Commands for Mac/Linux Users
- Hide Keyboard Text Input Icon on macOS Ventura Menu Bar
- 13.0 MacOS Ventura release date
- How to change the default location of Mac Screenshot
- How to set Out Of Office (OOO) on Outlook for Mac
- 30+ Zoom video communications application shortcuts for macOS
- How to install wget on macOS
- Mac turn dark mode on or off using terminal command
- Create Symbolic Link using Terminal Command
- Mac - How to Install VirtualBox
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to install homebrew (brew) on M1 Mac
- How to uninstall Microsoft Outlook on Mac
More Posts:
- SQL: Check if table exists - HowTos
- [fix] Docker - no matching manifest for linux/arm64/v8 in the manifest list entries [M/M2 Mac] - Docker
- How to identify the version of IntelliJ - HowTos
- How to remove or unstage a file from git staged area - Git
- How to Schedule Mails in macOS Ventura - MacOS
- How to check file permissions for your file using Linux/Unix/macOS Terminal Command - Linux
- Display full website URL/address in Safari macOS Browser - MacOS
- How to install homebrew (brew) on M1 Mac - MacOS