chmod +x file changes a file from rw-r--r-- to rwxr-x-r-x but really I only wanted rwx-r--r-- is this possible?
2 Answers
To change only the permission for the current user, you can use:
chmod u+x <file>Where u=user, g=group, o=others.
If you want to enforce the permissions you mentioned, this would be the ideal:
chmod u=rwx,go=r fileOptionally, you can do the same using the octal notation, as follows:
chmod 744 <file>This will set rwx (the 7) for user, and r (the 4's) for group and others.
Try running chmod u=rwx,go=r file.
In my case, that gives the permissions as rwx-r--r--, which I think is what you meant.