Created
May 6, 2017 11:34
-
-
Save riordanz/da1083c15604b826bee5ff836c5c6452 to your computer and use it in GitHub Desktop.
list user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clear | |
echo "Created By : FreeDroid" | |
echo "========================================="; | |
echo "USERNAME EXP DATE " | |
echo "========================================="; | |
while read mumetndase | |
do | |
AKUN="$(echo $mumetndase | cut -d: -f1)" | |
ID="$(echo $mumetndase | grep -v nobody | cut -d: -f3)" | |
exp="$(chage -l $AKUN | grep "Account expires" | awk -F": " '{print $2}')" | |
if [[ $ID -ge 1000 ]]; then | |
printf "%-17s %2s\n" "$AKUN" "$exp" | |
fi | |
done < /etc/passwd | |
JUMLAH="$(awk -F: '$3 >= 1000 && $1 != "nobody" {print $1}' /etc/passwd | wc -l)" | |
echo "-------------------------------" | |
echo "Jumlah akun: $JUMLAH user" | |
echo "-------------------------------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment