$ curl cheat.sh/
 cheat:xxd 
# To convert bin/string to hex:
echo '42 is the solution' | xxd -p
# output: 34322069732074686520736f6c7574696f6e0a

# To convert hex to bin/string:
echo '34322069732074686520736f6c7574696f6e0a' | xxd -r -p
# output: 42 is the solution

 tldr:xxd 
# xxd
# Create a hexadecimal representation (hexdump) from a binary file, or vice-versa.
# More information: <https://manned.org/xxd>.

# Generate a hexdump from a binary file and display the output:
xxd input_file

# Generate a hexdump from a binary file and save it as a text file:
xxd input_file output_file

# Display a more compact output, replacing consecutive zeros (if any) with a star:
xxd -a input_file

# Display the output with 10 columns of one octet (byte) each:
xxd -c 10 input_file

# Display output only up to a length of 32 bytes:
xxd -l 32 input_file

# Display the output in plain mode, without any gaps between the columns:
xxd -p input_file

# Revert a plaintext hexdump back into binary, and save it as a binary file:
xxd -r -p input_file output_file

$
Follow @igor_chubin cheat.sh