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 -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -