Dear All,
I have one file which looks like :
account1:passwd1
account2:passwd2
account3:passwd3
account1:passwd4
account5:passwd5
account6:passwd6
you can see there're two records for account1. and is there any shell command which can find out : account1 is the duplicate record in file?
Thanks.
awk -F":" '{_[$1]++}
END{
for (i in _)
print "Duplicated: _
}' filename
i guess there's one missing " in 4th line?
but after appending the " , it still doesn't work...
awk -F: 'x[$1]++ { print $1 " is duplicated"}' FILENAME