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

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -