Search code examples
linuxfile-permissionschmod

Change permissions of directory


I have a directory with drwxrwxr-x+ permissions. I want to change this permission to drwxr-xr-x

Please suggest the command to change the above permissions.


Solution

  • Let's analyze the desired result:

    drwxr-xr-x

    d just means this is a directory, we can ignore it:

    rwxr-xr-x

    translate it to binary code:

    11110101 (0 is equivalent to -).

    Translate each 3 digits to a decimal number:

    755: 111 → 7, 101 → 5

    Eventually just type this:

    chmod 755 <dirname>