I've been at this all day today and for some odd reason I can't get what I am doing wrong. What I am trying to do is run a command that will list only the duplicated names and show what line that duplicated name is on. Say for instance I run a particular command and it outputs this:
111 Timonthy Johnson
465 Tomonthy Johnson
and so forth.
So basically I'm trying to get a list of duplicated names that are indentical, but also get the line number of where it is in the list. I hope that makes sense? Here is what I have so far as a command:
cut -f5 -d: /etc/passwd | uniq -D |
Any suggestions? Like I said, I've been wracking my brain around this and haven't been able to find the solution. I'm not sure if I'm not looking in the right place or what.
I know that uniq -D part of the command lists only and all duplicated lines, which is what I want. But the part that I'm stumped on is getting what line it is on. Gosh, I hope I'm making sense of what I'm trying to do. lol