How to convert binary number to text/ascii?
Hi,
is there command in linux which is able to convert binary (0101001010000100) to text like it means something? Thx |
bc ibase=2 0101001010000100 should do the trick.
EDIT: I found another article that says you need to use echo and pipe to bc like this Code:
echo 'ibase=2;obase=A;0101001010000100' | bc Code:
wcalc 0b0101001010000100 |
I noticed those examples convert over, but not to the actual ASCII characters; ie 01110100011001010111001101110100 to test. Is there anyway to do that?
|
Quote:
|
Try
Code:
bin='01110100011001010111001101110100' Any non-printing characters can be converted to a dot or deleted using tr Code:
printf $(echo "obase=16;ibase=2;$bin" | bc | sed 's/../\\x&/g') | tr -c '[:print:]' '.' |
All times are GMT -5. The time now is 05:22 PM. |