Friday, 30 August 2013

How to compare two directory trees

When you want to see which files differ without further details:
diff -qr path/1/ path/2/
With a separate diff for each differing file:
diff -r path/1/ path/2/

Cheers.

Tuesday, 13 August 2013

How to find out the number of global variables in a binary

nm your-binary-file | grep '[0-9A-Fa-f]* [BCDGRS]' |cut -d ' ' -f 3 | grep -ve '__.*' | grep -v @@ | wc -l