Search

Tuesday, August 19, 2008

list of users and count total number of users

#!/bin/bash
for i in $(cat /etc/passwd | cut -d: -f 1) ; do
echo username:$i

done
echo "Total number of user is $(cat /etc/passwd | wc -l)"

No comments: