I got two files: file1 with about 10 000 lines and file2 with a few hundred lines. I want to check whether all lines of file2 occur in file1. That is: ∀ line ℓ ∈ file2 : ℓ ∈ file1
Should anyone not know what these symbols mean or what "check whether all lines of file2 occur in file1" means: Several equivalent lines in either files don't influence whether the check returns that the files meet the requirement or don't.
How do I do this?
Best Answer
This command will output lines unique to
file_2
. So, if output is empty, then allfile_2
lines are contained in thefile_1
.From comm's man: