From 76b088e0ce5ec06b50d752acd490b2d34fcda8d2 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sun, 28 Jul 2024 11:19:38 +0300 Subject: [PATCH] {bash,zsh}rc: add adduser-to-group() as I never remember the order otherwise --- rc/bashrc | 6 ++++++ rc/zshrc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/rc/bashrc b/rc/bashrc index 87adba1c..29e9e872 100755 --- a/rc/bashrc +++ b/rc/bashrc @@ -923,6 +923,12 @@ else } fi +# In Debian there is "sudo adduser whoever whatever", but I keep forgetting +# that the more common way is usermod -aG whatever,whereever whoever +adduser-to-group() { + usermod -aG "$2" "$1" +} + # Source files for miscannellious modifications. # acme.sh diff --git a/rc/zshrc b/rc/zshrc index 501d15f4..5a9a55ec 100755 --- a/rc/zshrc +++ b/rc/zshrc @@ -901,6 +901,12 @@ else } fi +# In Debian there is "sudo adduser whoever whatever", but I keep forgetting +# that the more common way is usermod -aG whatever,whereever whoever +adduser-to-group() { + usermod -aG "$2" "$1" +} + # Source files for miscannellious modifications. # acme.sh