J
J
j_bush2016-01-19 16:38:08
linux
j_bush, 2016-01-19 16:38:08

Two large files, how to quickly grep?

There are 2 files, one for 10k lines, the other for 174kk, you need to quickly extract these 10kk from 174kk =). I used grep -vFf but it was extremely slow =(. It seems that there is a -x parameter, but I did not understand the essence of its work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2016-01-19
@j_bush

If the order of the records is not important, then
comm -2 -3 <(sort big-file) <(sort small-file) > big-file-small-file

S
Swartalf, 2016-01-19
@Swartalf

"Extract" is to remove lines from one file that are in the second or just select and display?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question