Script to pull user name from password file

Script to pull user name from password file

root@node1:~# cat /etc/passwd |awk -F:  ‘{print $1}’
root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
proxy
www-data
backup
list
irc
gnats
nobody
systemd-timesync
systemd-network
systemd-resolve
systemd-bus-proxy
syslog
_apt
lxd
messagebus
uuidd
dnsmasq
sshd
ubuntu
ansible
test
user1

 

root@node1:~# cat /etc/passwd | cut -d : -f 1
root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
proxy
www-data
backup
list
irc
gnats
nobody
systemd-timesync
systemd-network
systemd-resolve
systemd-bus-proxy
syslog
_apt
lxd
messagebus
uuidd
dnsmasq
sshd
ubuntu
ansible
test
user1

Leave a Reply

Your email address will not be published. Required fields are marked *