From 7a6fe67cf1698785a5b165a0b36b3f3b9d86b1b9 Mon Sep 17 00:00:00 2001 From: Jools Wills Date: Mon, 19 Sep 2022 11:23:40 +0100 Subject: [PATCH] Add note about use of chown to change both user and group --- docs/Shell-Style-Guide.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/Shell-Style-Guide.md b/docs/Shell-Style-Guide.md index e4c10ded..d0cb0a40 100644 --- a/docs/Shell-Style-Guide.md +++ b/docs/Shell-Style-Guide.md @@ -94,6 +94,11 @@ if [[ "${my_var}" ]]; then fi ``` +### Changing user and group ownership of files + +Use `chown $user: [PATH]` instead of `chown $user:$user [PATH]` - the empty group parameter will cause chown to use the users login group. This resolves issues on systems where the user doesn't have their own group (eg. where all users are in a `users` group). + + ## Naming Conventions ### Function Names