V
V
vlarkanov2018-04-05 13:08:47
bash
vlarkanov, 2018-04-05 13:08:47

Comparing text files: how to display lines that are in the first, but not in the second?

Hello! There are two text files. Contain filenames (one per line, not repeated). The order may vary.
How to find lines that are only in the first file, but not in the second (the position in the file does not matter)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
key don, 2018-04-06
@vlarkanov

$ grep -f 2.txt -v 1.txt

spoiler
3
4

$ cat 1.txt
spoiler
1
2
3
4
5

$ cat 2.txt
spoiler
1
2
5
6
7

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question