% ./script.sh
zsh: permission denied: ./script.sh
If you are trying to execute a script on the Terminal using the Zsh shell and you get permission denied then make sure that the script has the execute permissions. You can do that by using the ls command.
% ls -ltrh
total 2832
-rw-r--r-- 1 code2care staff 5B Jul 19 11:50 script.sh
Adding execute permission to the file:
Use the chmod command to add execute (x) permissions to the script.
chmod +x script.sh
Now if I try to run the script again it works!
% ./script.sh
Hello, World!

zsh: permission denied
Have Questions? Post them here!
More Posts related to zsh,
- [fix] zsh: illegal hardware instruction python TensorFlow M1/M2 Mac
- macOS Ventura 13: The default interactive shell is now zsh
- Fix: cd: string not in pwd
- How to reload Zsh .zshrc Profile
- Resolve - zsh: command not found: code
- Ubuntu zsh: command not found: nano
- Fix: zsh: command not found: mysql (Mac XAMPP)
- Setting up Zsh Syntax Highlighting
- Fix zsh: permission denied: script.sh
- Fix - zsh: command not found: conda [macOS]
- zsh: command not found [fix] macOS
- ZSH: exec format error eclipse M1/M2 Mac
- Fix for zsh: command not found: brew
- Fix: zsh: command not found: npm after installation (Node.js)
- How to reload zsh shell profile file?
- How to Add New Entry to ZSH PATH
- How to make ZSH as the default shell on Ubuntu
- How to fix: zsh: command not found: jupyter
- How to clear ZSH history of commands executed on Mac Terminal
- Fix - zsh: command not found: pip
- Fix - cd: no such file or directory: .zshrc
- Add Syntax Highlighting in Zsh Shell
- Fix: ZSH: cd: too many arguments (macOS)
More Posts:
- Change Terminal Cursor Type in Mac (MacOS Shell) - MacOS
- Maven Central Repository: URL and Details - Java
- Android: Maps and Places using Maps SDK - Android
- Android: programmatically turn Bluetooth on or off using Java code - Android
- Trigger Flow on selected Listitem from SharePoint view - create button with JSON column formatting - SharePoint
- Bash command to wait for seconds - Bash
- JBoss stuck loading JBAS015899: AS 7.1.1.Final Brontes starting - Java
- Change CSS Background Opacity with Examples - CSS