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?

  • You'd be much more likely to get a good answer on Unix/Linux SE – evamvid Mar 11 '14 at 0:58
  • 4
    chmod u+x file. u=user, g=group, o=others. – jweyrich Mar 11 '14 at 1:15
  • 1
    @jweyrich put that as an answer -- that's more elegant and better than my way... – evamvid Mar 11 '14 at 1:17
  • 1
    The question probably has dozens of duplicates, but I posted it as an answer anyway. Glad it helped. – jweyrich Mar 11 '14 at 1:38
  • 2
    @evamvid this question is perfectly on topic here, no reason to suggest the OP take it to Unix & Linux. And I say that as a regular of both sites. – terdon Mar 11 '14 at 5:52

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 file

Optionally, 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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.