Convertions and replacements on Linux command line using hex


Here is some hex operations you can do with basic or built-in GNU Linux tools:


Convert a given string to hex using xxd

echo -ne 'your.wanted.string!' | xxd  -p


Replace a hex string on binary file using GNU sed:

sed -i -e 's/\x6e\x8e\xaf\x6e/your.replacement.string/g' /etc/ssl/certs/java/cacerts