How to convert binary numbers to decimal using the bash shell.

This one-liner will convert binary numbers to decimal. Very easy to do in the bash shell.

[email protected]:~$ echo "$((2#01110100011000010110101101))"
30508461

This is how to convert binary to Hexadecimal.

[email protected]:~$ printf '%x\n' "$((2#1111111))"
7f

These very useful one-liners should make converting number values even easier then ever before.

No comments have been made. Use this form to start the conversation :)

Leave a Reply