Comparing two files problem
Ok im trying to compare two files and I only want to display the user names that are in the first file and not the second.
So I have one file named final.txt (which contains every user name and only the user names in a list no other information) Then I have another file Over1.txt (which only contains certain users that have different permissions This file is also setup differently with the user name and some information about the user after the user name. I need a way to compare final.txt to over1.txt so that I will only display the names that are in final.txt but not Over1.txt Ive tried using diff and comm but just cant seem to get it two work correctly. Im not sure if im missing a option or what. |
Please post a few lines from each file so we know what the format is.
|
final.txt looks like this
bbenson bburt cconley and so on with names then the other file over1.txt bbenson : Bill Benson : /home/BillBenson: /bin/bash bburt : Bill Burt : /home/BillBurt: /bin/bash and so one with all the users |
This
Code:
diff -w final.txt <(cut -d: -f1 over1.txt) Code:
3d2 |
Does this work? final.txt may already be "cleaned" in which case no need for that step
Code:
cat over1.txt | awk '{ print $1 }' | sort | uniq > over1.cleaned.txt |
Quote:
|
All times are GMT -5. The time now is 12:52 PM. |