Does `chmod +x` make a file an executable or does it assign execute permission on the file?

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:

  1. permission to read the file. For directories, this means permission to list the contents of the directory.
  2. permission to write to (change) the file. For directories, this means permission to create and remove files in the directory.
  3. 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like