Grep command inaccurate or bad command? Windows WSL

Solution 1:

>> means "append to file" while > means "overwrite file"
but as an example I generated 2 files of random UUIDs, file2 has 100 unique lines, file1 has 50 unique ones, plus all the ones from file2, shuffled to a totally random order

$ wc -l file2.txt file1.txt
 100 file2.txt
 150 file1.txt

then I do your command

$ grep -v -f file2.txt file1.txt >> file3.txt
$ wc -l file3.txt
 50 file3.txt

just as expected, but now watch what happens if I run it again:

$ grep -v -f file2.txt file1.txt >> file3.txt
$ wc -l file3.txt
 100 file3.txt

all your problems seem to be because you misunderstood the linux shell redirection operands