Tag Info

New answers tagged

3

It is an option open VIM and run :set hlsearch To turn it off :set nohlsearch See http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches for details


0

xxdiff is unmatched if you just need to graphically see the changes between two files (or directories!): Like regular diff and comm, your input files should be sorted first. sort file1.txt > file1.txt.sorted sort file2.txt > file2.txt.sorted xxdiff file1.txt.sorted file2.txt.sorted


4

No matter if your file1 and file2 are sorted or not, use awk command as follows: unique data in file1: awk 'NR==FNR{a[$0];next}!($0 in a)' file2 file1 4 5 6 unique data in file2: awk 'NR==FNR{a[$0];next}!($0 in a)' file1 file2 a b c common data: awk 'NR==FNR{a[$0];next} ($0 in a)' file1 file2 1 2 3 Explanation: NR==FNR - Execute next block ...


4

This is what comm is for: $ comm <(sort file1) <(sort file2) 1 2 3 4 5 6 a b c The first column is lines only appearing in file 1 The second column is lines only appearing in file 2 The third column is lines common to both files comm requires the input files to be sorted To exclude any column from appearing, add ...



Top 50 recent answers are included