Does chmod +x make a file an executable or does it assign execute permission on the file?
For example - chmod 111 will allow execute permission to user, group, everyone else.
1 Answer
It assigns a permission.
per chmod(1) - OpenBSD manual pages
The chmod utility modifies the file mode bits of the listed files as specified by the mode operand. The mode of a file dictates its permissions, among other attributes.
Based on some reading over here: Mode StructureThe file mode bits that are being modified are "file permission bits"
27.1 Structure of File Mode Bits The file mode bits have two parts: the file permission bits, which control ordinary access to the file, and special mode bits, which affect only some files. There are three kinds of permissions that a user can have for a file:
- permission to read the file. For directories, this means permission to list the contents of the directory.
- permission to write to (change) the file. For directories, this means permission to create and remove files in the directory.
- permission to execute the file (run it as a program). For directories, this means permission to access files in the directory.
This was some neat reading.