Skip to content

Instantly share code, notes, and snippets.

@noodlebreak
Last active April 12, 2016 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noodlebreak/60a2ba91d9d81e04db3032c00e210eaf to your computer and use it in GitHub Desktop.
Save noodlebreak/60a2ba91d9d81e04db3032c00e210eaf to your computer and use it in GitHub Desktop.
# Credits goto: Stackoverflow user gnperumal; http://stackoverflow.com/a/12172706/1114457
# simple bash function list all the users in a group
# requires a python installation
function listusersofgroup {
python -c "import grp; print grp.getgrnam('$1')[3]"
}
# Usage: listusersofgroup <group-name>
# Gives:
['user1', 'user3', ..]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment