Computing.Net > Forums > Unix > comparing string in a file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

comparing string in a file

Reply to Message Icon

Name: raxyshah
Date: February 27, 2003 at 14:40:07 Pacific
OS: hpux
CPU/Ram: 233
Comment:

hi,
i need to compare two files and get the line that is common.i tried it using comm command but it doesnt work.the problem is say my file
a.txt is abc
def
ghi
and my file b.txt has
xyz
abc
pqr
i need to somehow trap the string abc which is common for both files....
thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: February 27, 2003 at 17:45:54 Pacific
Reply:

fgrep -f file1 file2

Check the man page for addtional options that you might want to use with the command.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: comparing string in a file

Adding a new string in a file www.computing.net/answers/unix/adding-a-new-string-in-a-file/8060.html

change string in multiple file www.computing.net/answers/unix/change-string-in-multiple-file/4697.html

Compare Lines within a file www.computing.net/answers/unix/compare-lines-within-a-file/7893.html