Quick fix to Zsh: Permission denied Terminal error
- "Permission denied" means access or execution is blocked
This error usually happens because macOS doesn't allow Terminal to run or access a file due to missing permissions, ownership issues, or security restrictions. - Start by checking permissions before fixing anything
Usels -lto inspect file permissions. If the execute permission (x) is missing, add it withchmod +xbefore trying more advanced fixes. - Fix common causes with the right commands
Usechmodto make files executable,chownto take ownership, andchmod -R u+rwXfor folders. These commands solve most permission-related issues. - macOS security settings can block access
Terminal may need Full Disk Access in System Settings, and downloaded files might have a quarantine flag that prevents execution until removed. - Tools like Setapp apps can simplify Terminal workflows
Apps like Core Shell and Almighty make it easier to run commands, customize Terminal, and manage system settings without memorizing complex commands. Try them via Setapp.
Opening a file on macOS is usually a breeze — just double-click, and you're good to go. You can also use Terminal by running a simple command to open the file. But sometimes, things don't go as smoothly. If you've ever tried opening a file in Terminal and got the "zsh: permission denied" error, you know it's not just a simple command issue. It usually means there's something off with the file or macOS itself.
In this article, I'll walk you through how to fix the "Terminal permission denied" issue, so you can get back to work without any hassle.
Fix the "zsh: permission denied" error: Key steps to try
I'll start with a table that summarizes the most reliable, up-to-date solutions in priority order for typical scenarios (script execution, file access, directory operations). If you need more detailed instructions, just scroll down.
| How to fix the error | Instructions |
|---|---|
| Make a script or file executable | 1. Open Terminal. 2. Type: chmod +x<br> 3. Drag the file into Terminal (path appears). 4. Press Return. Then run with ./filename |
| Fix ownership (file owned by root/other user) | 1. In Terminal, type: sudo chown $(whoami) 2. Drag the file/folder into Terminal. 3. Press Return, enter password. For folders: add -R after chown (careful—test on single file first). |
| Add execute rights recursively (folders/scripts) | 1. Type: chmod -R u+rwX 2. Drag folder into Terminal. 3. Press Return. (u+rwX = user read/write/execute on dirs, execute only where needed.) |
| Grant Terminal Full Disk Access (protected areas) | 1. Go to System Settings > Privacy & Security > Full Disk Access. 2. Toggle Terminal on. 3. Quit/reopen Terminal. |
| Remove quarantine flag (downloaded files) | 1. Type: xattr -d com.apple.quarantine2. Drag file into Terminal. 3. Press Return. Check first with xattr -l if needed. Only use on trusted files! |
| Verify permissions first (always start here) | 1. Type: ls -l2. Drag file/folder into Terminal. 3. Press Return. Look for rwxr (owner execute) or missing 'x'—guides next fix. |
| Use Terminal alternatives | Install Core Shell to customize your Terminal and run any command. Alternatively, use Almighty to manage configurations and help resolve the "Zsh: permission denied" Terminal error. |
Before we go into the details of the issue, let's clarify some basic terms.
What is Terminal on Mac?
Mac's Terminal app is frequently used to operate your device with a variety of commands. To use it, you only need to be familiar with fundamental functions and commands, which you can then enter into the command line.
For example, if you want to move a system file from one folder to another, you must use the move command "mv" and specify the destination folder.
Why use Terminal on Mac?
Mac users prefer Terminal for a variety of reasons. First of all, it's a fast way to run processes and tasks for those familiar with Unix commands. The other major advantage of utilizing Terminal is that it allows you to access parts of macOS that are hidden and not accessible through System Settings.
How do you open Terminal?
To open Terminal on your Mac:
- Go to Finder > Applications > Utilities folder.
- Double-click Terminal.
Alternatively, press Command + Space to launch Spotlight. Type "Terminal" and double-click it from the results.

You can also press Command + Space to launch Spotlight. Then type "Terminal" and double-click it from the results.
If you use iStat Menus for monitoring features, you can also open Terminal from there. It's available from the Disks category.
Why does Terminal show "permission denied"?
If you see an error message like this, it means Terminal is unable to perform the command you're attempting to run.

The "zsh: permission denied" error in Terminal usually stems from permission issues with the specific file or directory you're trying to access. Here are the most common causes:
- The file is locked: You might not have administrator access, or the file's creator used
chmodto lock it. - Incorrect command formatting: The command has been formatted wrongly.
- macOS security restrictions: Terminal lacks Full Disk Access permissions. Symlinks can act up after Mac operating system updates due to tighter security. If ls -l shows a symlink (l at the start) but commands fail, try recreating it or check the target path has proper access.
How to fix the "zsh: permission denied" error on Mac?
Below are a few methods you can try to fix the issue.
Check file permissions
To verify permissions on your file or folder:
- Open Terminal from the Mac's utilities menu.
- Type the following command: ls -l. Make sure to add a space after the final character.
- Find the file or folder you're working on and drag it into Terminal.
- Press the Return key.
The output displays specific permissions that are available to the current user. You can read, write, and execute the file if the letters "rwxr" appear in the string of characters before your username in the result. If you just see one letter, such as "r," the file is read-only for you.

Permission settings determine who can view and alter files on the computer. Next, I'll show you how to change the permissions.
Modify the file permissions
If the "permission denied" Terminal problem is caused by the permissions you just verified not allowing you to write to a file, try to repair it. To do so:
- Right-click the folder or file you're working on > Get Info.
- Click the arrow if the information in Sharing & Permissions isn't accessible.
- In the Name column, choose a user or group.
- Select a privilege setting from the pop-up menu.

Change directory ownership
If changing permissions didn't resolve the issue, try changing the directory's ownership to your username. Change [username] to your username and [directorypath] to the path of the directory you wish to change ownership of in the steps below – you can just drag the folder onto the Terminal window as we did previously.
- Drag the folder onto the Terminal window.
- Type: sudo chown -R $(whoami):staff .
- Drag the folder into Terminal.
- Press Return and enter your password when prompted.
When you drag a folder into Terminal, its full path appears automatically — no need to type it manually.
Grant Terminal complete disk access
It's also possible that the Terminal doesn't have full access to the drive, which is why you can't use commands to open the file. To give Terminal full disk access:
- Go to System Settings > Privacy & Security.
- Scroll down and click Full Disk Access.
- Toggle Terminal on to add it to the list of apps that can control your Mac.
Quit and reopen Terminal.
What else can you do to resolve the "zsh: permission denied" issue?
Another method you can try is to use Mac's Terminal alternative – Core Shell. This terminal emulation app will allow you to customize your Terminal to be precisely what you want it to be: useful, minimal, and attractive.
With Core Shell , you can run any commands, just like with the native Mac Terminal. The app has a great user interface, which you'll enjoy. Core Shell also supports one-click login on remote computers with auto-reconnect capability. But what you'll probably like the most is the ability to change the look and feel of your terminal. You can change the color scheme of connections by using your favorite shades.

"Zsh: permission denied" error: Resolved
Permission issues with the file or directory you want to work on are frequently the cause of the "zsh: permission denied" error in Terminal. You may generally fix it by re-assigning ownership or altering permissions.
In this article, I recommend that you try Core Shell and Almighty. The first app is a full-featured SHH terminal. The second app is a convenient and easy-to-use menu bar app that exposes powerful configurations for your Mac. Note that both apps will arrive with Setapp, a platform that hosts 250+ tools for solving everyday tasks on Mac and iPhone. You can use them 7 days free, then $9.99 + tax зук month.
FAQ
What is Zsh on a Mac?
Zsh on Mac, or Z shell, is a Unix-based command-line shell used in the Terminal app on macOS (since Catalina and later). It allows users to run various commands and processes efficiently. It builds on bash but adds handy extras like smart tab-completion, spell-check, and easy plugin or theme support. You open it through the Terminal app to run scripts, manage files, and automate tasks.
How do I reset Zsh on my Mac?
To reset zsh to defaults: Back up your config with mv ~/.zshrc ~/.zshrc.backup (and ~/.zprofile if customized), then quit and reopen Terminal. zsh will create a fresh minimal config. Restore custom lines from the backup later if needed.
Should I install Zsh on Mac?
Zsh is already pre-installed on macOS, starting from macOS Catalina. Installing it separately is unnecessary unless you have a customized requirement or prefer a different shell configuration. However, apps like Core Shell can provide additional features and customization options if you're looking for enhanced terminal functionality.
How do I get out of Zsh on Mac?
To get out Zsh in Terminal, simply type the command exit or press Control + D. This will close the current shell session. For a more integrated experience, you might use apps like Almighty to manage various system tasks, including terminal sessions, from a convenient menu bar interface.
How do I fix the "zsh: permission denied" error on Mac?
Try these steps in order:
- Check permissions:
ls -l path/to/file; if no "x," add it withchmod +x path/to/file - Take ownership:
sudo chown $(whoami) path/to/file - Fix a whole folder:
chmod -R u+rwX path/to/folder - Give Terminal full access: System Settings > Privacy & Security > Full Disk Access, then add Terminal
Run the command again—one of these steps usually clears the error.
What chmod command lets me run a script without "permission denied"?
Use chmod +x /path/to/script.sh. The +x flag adds execute rights so you can run the script with ./script.sh.
I used chmod, but I still get "permission denied." What else could be wrong?
Check these common roadblocks:
- Ownership:
sudo chown $(whoami) fileif another user owns the file - Parent folders: every folder needs execute (
x) rights. Fix withchmod +x folder - Quarantine flag: clear downloads with
xattr -d com.apple.quarantine file - Disk access: ensure Terminal has Full Disk Access in System Settings