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.


✏️ 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.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!