2014/12/26

Diff commands

diff -u <(./cmd1) <(./cmd2)

Find files without some content:
diff -u <(ag -l) <(ag -l content) | grep "^-\b"

To install ag:
https://github.com/ggreer/the_silver_searcher

Get the filepaths out of a diff:
ag '^\+\+\+' diff | cut -d' ' -f2 | sed -re 's,^b/,,'
ag '^\+\+\+' diff | cut -d' ' -f2 | sed -e 's,^b/,,' | sed -e '/\/dev\/null/d'

No comments:

Post a Comment