Different rights for files and dirs

This is one snippet that I sometimes need, but always forget how it looks like:

  • to change directory rights:

find . -type d -exec chmod 740 „{}“ \;

  • to change file rights:

find . -type f -exec chmod 640 „{}“ \;

Obviously I do not need it often enough (or I would rembember it and this posting would not have happened), or I am a linux noob – I am not sure yet.

At least, now I know where to copy and paste from next time.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.