Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
habrok:data_management:sharing_data [2025/03/07 16:10] – Add Fokke's expanded shared dir docs pedrohabrok:data_management:sharing_data [2025/06/11 08:31] (current) – [Fixing file and directory permissions] Add syntax highlighting pedro
Line 122: Line 122:
  
 When permissions in a group directory are wrong, the person owning the files can fix these using the ''chmod'' command. You can use the output of ''ls -l'' to find the owner of the file. First we need to fix the read/write/execute permissions. This can be done for a single file or directory using: When permissions in a group directory are wrong, the person owning the files can fix these using the ''chmod'' command. You can use the output of ''ls -l'' to find the owner of the file. First we need to fix the read/write/execute permissions. This can be done for a single file or directory using:
-<code>+<code bash>
 chmod g+rwX file_or_directory chmod g+rwX file_or_directory
 </code> </code>
Line 128: Line 128:
  
 If you want to change the permission for a directory, including all files and subdirectories inside, one can add the ''-R'' flag to make the command recursive: If you want to change the permission for a directory, including all files and subdirectories inside, one can add the ''-R'' flag to make the command recursive:
-<code>+<code bash>
 chmod -R g+rwX directory_name chmod -R g+rwX directory_name
 </code> </code>
  
 To prevent new files from being owned by the private group of the creator the sgid bit must be set on directories. This can be done using: To prevent new files from being owned by the private group of the creator the sgid bit must be set on directories. This can be done using:
-<code>+<code bash>
 chmod g+s directory_name chmod g+s directory_name
 </code> </code>
  
 Since this sgid bit should not be used on files, we cannot use the ''-R'' option. If many directories must be fixed, we can automate this using the ''find'' tool, e.g.: Since this sgid bit should not be used on files, we cannot use the ''-R'' option. If many directories must be fixed, we can automate this using the ''find'' tool, e.g.:
-<code>+<code bash>
 find . -type d -exec chmod g+s {} \; find . -type d -exec chmod g+s {} \;
 </code> </code>
Line 144: Line 144:
  
 Finally giving other groups read and execute access can be achieved using: Finally giving other groups read and execute access can be achieved using:
-<code>+<code bash>
 chmod o+rX file_or_directory chmod o+rX file_or_directory
 </code> </code>