Skip to content

Instantly share code, notes, and snippets.

@thanoskoutr
Created April 23, 2021 20:53
Show Gist options
  • Save thanoskoutr/17bd26e5af13b45bf8345843142ea3ae to your computer and use it in GitHub Desktop.
Save thanoskoutr/17bd26e5af13b45bf8345843142ea3ae to your computer and use it in GitHub Desktop.
A simple script to list all users in a Linux system.
#!/bin/bash
if [[ "$1" == "-h" ]] ; then
echo "usage: `basename $0` [-h]"
echo "Prints all unix users."
exit 0
fi
cut -d: -f1 /etc/passwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment