Hvalec.

← Logs

Making a file executable on macOS

Quick note to self: use chmod to make a script executable.

chmod +x script.sh

Then run it with:

./script.sh

Verify it worked with ls -l script.sh, you should see an x in the permissions, e.g. -rwxr-xr-x.

The one that matters is the owner's execute bit, the x in rw(x)r-xr-x. That's the one that lets you actually run the script.


Created: 2026-08-19