I have 2 files file1 which contains
1,2,3,4,5
file2 contains
4,5,6,7,8
output should be in such a way that new file assume it as file3 should contain
1,2,3,4,5,6,7,8,
and not only that if contents in file1 and file2 changes like
file1 new contents
10,11,12,13,14
file2 new contents
13,14,15,16,17,18
after merging file3 should should contain below values
1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18
I have tried several commands like sort, uniq, cat etc but it haven't worked
touch file3; cat file1 file2 file3 | sort | uniq? You will need to translate the commas to newlines.sedortrwill do that for you.