Wat does this command do?
fileA is a subset of fileB..now, i need to find the lines in fileB that are not in fileA...i.e fileA - fileB.
diff fileA fileB gives the ouput but the format looks no good....
I just need the contents alone not the line num etc.
diff is the command for you
for ex: the contents of fileA is
A
B
C
and that of fileB is
A
C
now,diff fileA fileB
would give
2d1
< B
as the output
But i need only the difference not the line info ....
i.e the output should be
B
Use..
grep -vf infile1 infile2
where infile1 is a subset of infile2
are u sure..?
grep -vf file1 file2 does not work as intended.somother solution,please.
The below will work....
$ cat infile1
A
B
C
$ cat infile2
A
C
$ grep -vf infile2 infile1
B
here are the 2 file say "A" and "B"
file "A" contains
hey
the
output
is
while file "B" contains
hey
the
updated
output
later
is
Now if you try the command
diff A B
The output will be
2a3
> updated
3a5
> later
grep -vf file1 file2
also works fine as suggested by whiteboard
provided file1 is a subset of file2
Hope this helps
Thanks Whiteboard n gaurvacl...
that works absolutely fine...great!