Recently when I tried to run ls command in 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 in desktop.
✏️ You can get such a error while trying to access Network volumes, Download or Documents folder if the option in Files and Folders is unchecked for Terminal.
- Open New Terminal Window Using Keyboard Shortcut macOS
- How to Refresh Mac Desktop
- How to remove app from Dock when closed [macOS Big Sur]
- WARNING: Python 2.7 is not recommended [macOS Big Sur]
- Terminal Command to get the list of available shells in macOS
- Add Bookmark macOS Safari
- Youtube spacebar not working in search on macOS Safari
- How to refresh Safari on Mac (macOS) using keyboard shortcut
- How to know your Mac Screen Resolution?
- Disable Startup Sound on macOS
- bash: command not found error [macOS Terminal Linux, Unix or Windows]
- Test internet speed using macOS Terminal command
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- Limit scrollback rows in macOS Terminal
- [macOS] Change homepage Macbook Safari Browser
- wget Command on macOS Terminal
- How to install Java on macOS [Big Sur]
- How to increase macOS Terminal text font size (Big Sur)
- How to check zsh installed version using terminal
- This operation couldnt be completed. Unable to locate a Java Runtime. [macOS]
- ls: .: Operation not permitted - Mac Big Sur Terminal Zsh Error
- How to install maven in macOS using Terminal Command
- How to open new tabs macOS Terminal
- How to uninstall GarageBand from Mac
- How to Restart Mac using Terminal Command