The dc command 💽

I stumbled across the dc command, after mistyping cd. It’s a math tool. It’s pretty esoteric in my opinion, but you can switch bases, which means you can do something like convert from a hex color to rgb, albeit digit-by-digit.

For example, if you wanted to convert the hex color #FAFBFC, you’d convert FC, then FB, then FC (note the uppercase is necessary for dc).

dc -e '16 i FA p' # 250