Categories
How to output lines in file 1 if there is a line match with file 2?
How to output lines in file 1 if there is a line match with file 2? File 1 1: Vasya 2: Petya 3: Kolya 4: Ivan File 2 Vasya Igor Ivan Required output: 1: Vasya 4: Ivan
Answer the question
In order to leave comments, you need to log in
fgrep -if ./file2.txt ./file1.txt -i- case-insensitive search (if necessary) -f- get a list of strings to search from the specified file, line by line
fgrep -if ./file2.txt ./file1.txt
-i
-f
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question