Matt Parkins
Matt Parkins

Reputation: 24688

Output line from file1 if not found in file2

I need to output the lines from file1 that are not found in file2, ideally using linux commandline.

Both files are uppercase A-Z, sorted, per-file unique, and contain only one word per line. Typically, file1 is between 5 and 100 lines long, file2 is 250,000 lines long. Processing speed is not an issue.

Upvotes: 0

Views: 1920

Answers (1)

dza
dza

Reputation: 1504

grep -vhFxf file1 file2

Works great.

Upvotes: 3

Related Questions