execute permission
The permission that lets a file be run as a program, or lets you enter a directory.
In more detail
A new script is not executable, so ./script.sh fails with Permission denied until you run chmod +x script.sh. bash script.sh still works without it, because then bash only reads the file. On a directory, execute means you may enter it and reach the files inside by name.
Example
chmod +x script.sh && ./script.shRelated terms
- chmod — A command that changes a file's permission bits, using either octal digits or symbolic changes.
- file permissions — Rules on each file saying which user and group own it and who may read, write or run it.
- shebang — The first line of a script, starting with #!, that names the program the operating system should use to run it.
Taught in
- Moving Around: pwd, ls, cd And Paths — Bash Scripting & Command Line Automation
- Shebangs, Permissions And Three Ways To Run — Bash Scripting & Command Line Automation
- Exit Codes, And What Success Means — Bash Scripting & Command Line Automation
- Permissions And Ownership — Bash Scripting & Command Line Automation