I have the habitÂ to chmodÂ with the relative notation (e.g. g+w or a+r or go-w or similar)Â instead of the absolute one (e.g. 0640 or u=rw,g=r,o=). Recently I had to chmodÂ a lot of files. As usual I was using the relative notation. With a lot of files, this took a lot of time. Time was not really an issue, so I did not stop it to restart with aÂ better performingÂ command (e.g. find /path â€“typeÂ f â€“print0Â | xargsÂ â€“0 chmodÂ 0644; find /path â€“typeÂ d â€“print0Â | xargsÂ â€“0 chmodÂ 0755), but I thought a little tips&tricks posting may be in order, as not everyone knows the difference.
The relative notation
When you specify g+w, it means to remove the writeÂ accessÂ for the group, but keep everything else like it is. Naturally this means that chmodÂ first has to lookup the current access rights. So for each asyncÂ write request, there has to be a read-request first.
The absolute notation
The absolute notation is what most people are usedÂ to (at least the numeric one). It does not need to read the access rights before changing them, so there is less I/O to beÂ done to get what you want. The drawback is that it is not so nice for recursive changes. You do not want to have the x-bit for data files, but you need it for directories. If you only have a tree with data files where you want to have an uniform access, the example above via find is probably faster (for sure if the directory meta-data is still in RAM).
And if you have a non-uniform access for the group bitsÂ and want to make sure the owner has writeÂ access to everything, it may beÂ faster to use the relative notation than to find a replacement command-sequence with the absolute notation.