Skip to content

Instantly share code, notes, and snippets.

@brohee
Last active March 31, 2022 11:52
Show Gist options
  • Save brohee/9dfcd273397addceee547014406f336b to your computer and use it in GitHub Desktop.
Save brohee/9dfcd273397addceee547014406f336b to your computer and use it in GitHub Desktop.
Creates a script from an /etc/group file in order to reproduce groups on another computer. Linux oriented.
# creates a groupadd sequence reproducing the GIDs of groups created on a machine
# in order to replicate it
cut -f1,3 -d: /etc/group | awk -F ':' '{print "\n# creating group " $1 "\n" "groupadd -g " $2 " " $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment