From f9ba2681702c6769e50dea8cd3cb897423b9c6d5 Mon Sep 17 00:00:00 2001 From: zeus Date: Fri, 26 Feb 2021 16:29:53 +0100 Subject: [PATCH] num of users in group --- bash/get_num_of_groups_for_all_users_in_group.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 bash/get_num_of_groups_for_all_users_in_group.sh diff --git a/bash/get_num_of_groups_for_all_users_in_group.sh b/bash/get_num_of_groups_for_all_users_in_group.sh new file mode 100644 index 0000000..1ee66c1 --- /dev/null +++ b/bash/get_num_of_groups_for_all_users_in_group.sh @@ -0,0 +1,6 @@ +#!/bin/bash +GROUP="proj_mastcamz_mf"; echo "num groups for"; for i in $(getent group $GROUP | cut -d ":" -f 4 | sed 's/,/ /g'); do echo -n "$i: "; id $i | sed 's/,/\n/g' | wc -l; done +# output: +# num groups for +# user1: 26 +# user2: 30