I am using grep -v to parse strings which are not present in desired file from target file, however the process was taking too long (>12 hours) and was eventually killed by the machine without finishing the task.
The command I used:
grep -v -f desire.txt target.txt >> no_in_desire_file.txt
The desire.txt
has 45502 strings; target.txt
has 268101 strings.
Could someone shares with me your experience to speed up the grep process? I am not good in Python or Perl, unfortunately.
UPDATED:
The suggestion by @John1024 improved the speed of the grep
process.
If it contains just plain strings, then add the -F option for fixed strings. This greatly speeds grep. – John1024