domingo, 2 de julio de 2017

Linux: Set permissions 644 for files, 755 for directories

The easiest way is to do:
chmod -R u+rwX,go+rX,go-w /foo
which basically means:
to change file modes -Recursively by giving:
  • user: read, write and eXecute permissions,
  • group and other users: read and eXecute permissions, but not -write permission.
Please note that X will make a directory executable, but not a file, unless it's already searchable/executable.

Linux: Patch file

Per crear l'arxiu diff:

diff -Naur original_folder_file modified_folder_file > whatever.diff

Per aplicar-lo:

patch file_target < whatever.diff