in reply to chmod 775 on all files

Or if you just want to turn on the write bit for user and group, use the symbolics...

chmod -R ug+w .

Replies are listed 'Best First'.
Re: Re: chmod 775 on all files
by bronto (Priest) on Jul 30, 2003 at 11:58 UTC
    chmod -R ug+w .

    Actually, the effect of this command is filtered by the current umask setting, while chmod -R 775 . wouldn't

    Ciao!
    --bronto

    Update: After Abigail-II's reply I double checked the man page, and he is actually right:

    A combination of the letters `ugoa' controls which users' access to the file will be changed: the user who owns it (u), other users in the file's group (g), other users not in the file's group (o), or all users (a). If none of these are given, the effect is as if `a' were given, but bits that are set in the umask are not affected.

    So, for example, chmod +rx and chmod a+rx behave differently, depending on the umask.

    What remains from what I wrote above and from Abigail's reply is that you should those ugly numerical file modes if you want to run on the safe side :-)


    The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
    --John M. Dlugosz
      Whether or not it's filtered by the current umask setting depends on the implementation of chmod. It certainly doesn't look at umask on the Redhat Linux I just tried it on.

      It does, however, pay attention to umask if I don't put a modifier before the +.

      A few years ago, during the PPT project, I implemented chmod in Perl. I looked at 5 different implementations (HP-UX, SunOS, Solaris, OpenBSD and GNU), and none of them behaved the same as any other implementation. None of the implementations acted as documented either. Of course, they all did the same for simple things, but they started deviating when giving more estoric parameters. Quick, what does your chmod do when doing:

      chmod =,o+s file_or_directory

      Abigail