To list only usernames type the following awk command:
$ awk -F':' '{ print $1}' /etc/passwd
Second Way:
sed 's/:.*//g' /etc/passwd
Third Way:
cut -d: -f1 /etc/passwd
$ awk -F':' '{ print $1}' /etc/passwd
Second Way:
sed 's/:.*//g' /etc/passwd
Third Way:
cut -d: -f1 /etc/passwd
Comments
Post a Comment