bash - find and save words from 2 files -
i have 2 txt file's words (1.txt , 2.txt)
1.txt
abc cda sda era 2.txt
krt gor abc sda rtr how can obtain list of words in both 1.txt , 2.txt?
example of need obtain result
output.txt
abc sda thank you.
use gnu grep:
grep -wf file1 file2 or
grep -wf file2 file1 output:
abc sda
Comments
Post a Comment