Powered by Blogger.

Friday, January 29, 2010

Set Operations

In Linux you can make operations with files quickly. Test the following commands which help you a lot to manipulate files.

LANG=C sort file1 file2 | uniq" = "Make the union of unsorted files"

LANG=C sort file1 file2 | uniq -d = "Intercept unsorted files"

LANG=C comm file1 file2 | sed 's/^\t*//' = "Union of sorted files"

LANG=C comm -3 file1 file2 | sed 's/^\t*// = "Symmetric difference of sorted files"

0 comments

Post a Comment