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