Chmod equivalence of +x and 0755
Solution 1:
chmod 0755 file
is equivalent to u=rwx (4+2+1),go=rx (4+1 & 4+1). The 0 specifies default special modes (see comment below). See wikipedia for more info (including tables describing u,g,o,a and r,w,x,s,t,).
So in other words: No, they're not equivalent since 0755 contains more flags.
See also: chmod man page
Solution 2:
Chmod number sets the permissions to exactly that number. Chmod relative only changes the requested bits. A file whose permissions were 000 before chmod +x
will now be 111. Conversely, a file whose permissions were 0775 before (read+write+execute for owner and group; read and execute for others) will be unchanged by chmod +x
, whereas setting the mode to exactly 0755 will change the 020 bit (remove write access for group).
Solution 3:
No, because chmod 755
also sets various read and write flags.