Make a Script Executable with chmod +x
Fix 'Permission denied' when running a shell script on macOS by adding the execute permission with chmod.
01Command
$ chmod +x backup.sh02What it does
macOS only runs a script directly if it carries the execute permission bit, and files created by some editors or extracted from archives lose it. chmod +x adds execute for the owner, group, and others; afterwards you can launch the script with ./backup.sh instead of sh backup.sh. Finder's Get Info 'Execute' checkbox edits the same bit but only for the owner, which often isn't enough for scripts that came from the internet.
03Risk
04Undo
$ chmod -x backup.sh05Sources
- chmod - Change access permissionsEvidence: Documents chmod's syntax 'chmod mode file' and explains modes grant execute permission; the page covers both symbolic and absolute modes.
- CHMOD(1) - macOS manual pageEvidence: The manual page explains the symbolic mode ugoa with +x adding execute permission for the file.
Last verified: 2026-09-19 · Category: Files & Folders
06Related solutions
Point macOS screen captures at any folder you choose instead of the desktop.
Grab any file from the web straight into the current folder — no browser needed.
List the biggest files in your home folder that are eating disk space.