man chmod
You can not change the directory flag with
chmod, only the permission bits.*
@creatxr: Let me make a little search in my info sources; I remember having seen something related some time or other but I don't remember whether it can be done or not--although I think it can.
* In case there is any doubt:
[... discussion of UGO-RWXS options omitted ...]
A numeric mode is from one to four octal digits (0-7), derived by adding up bits with values 4, 2, and 1. Omitted digits are assumed to be leading zeros.- The first digit selects the set user ID (4) and set group ID (2), and restricted deletion or sticky (1) attributes.
- The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1);
- The third selects permissions for other users in the file's group, with the same values; and
- the fourth for other users not in the file's group, with the same values.
[...etc...]
(Re-formated by myself)