List file content
I have two files as below , I would like to compare the content
file 1 ====== aaa.txt 111 222 bbb.txt 333 ccc.txt ddd.txt eee.txt file 2 ====== aaa.txt 444 bbb.txt 555 ccc.txt ddd.txt eee.txt Result ====== aaa.txt 111 222 aaa.txt 444 bbb.txt 333 bbb.txt 555 ccc.txt ccc.txt ddd.txt ddd.txt eee.txt eee.txt Some content is the same ( eg. aaa.txt , bbb.txt , ccc.txt , ddd.txt , eee.txt ) , I would like to list its content by a condition to a file as the above result file - if the line is the same then output its next line(s) to the result file , can advise what can i do ? thanks. |
Not sure what exactly you are going for at the end, but have you tried using diff and/or sort? Maybe join also.... Have a look here - http://linux.about.com/od/lts_guide/a/gdelts43.htm
|
All times are GMT -5. The time now is 05:23 PM. |