I want to find difference between two files and output only lines which are not present in second file .I am using awk and I am getting only the first difference but I want to get all the lines which are not present in file2 .Below is the code I am using . Please help to get the desired output .
Thanks for your prompt response . But I am getting few common lines as well with the below code i.e lines which are common to both the files but not all few of them .Your help is highly appreciated .
awk ' NR==FNR { a[$0]; next } !($0 in a)' file2.txt file1.txt
Pls show detailed, abbreviated but representative, samples of respective files, supported by e.g. a hexdump of each. so we stop shooting in the dark and start a data driven analysis.
I am attaching two files namely file1 and file2.I have removed /proc and /opt file system in file2 . Now when I use below command it is giving me two more file system along with /proc and /opt .
awk ' NR==FNR { a[$0]; next } !($0 in a)' file2.txt file1.txt