Conversion hex string into ascii in bash command line

前端 未结 7 1494
孤独总比滥情好
孤独总比滥情好 2020-12-12 23:43

I have a lot of this kind of string and I want to find a command to convert it in ascii, I tried with echo -e and od, but it did not work.

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 00:20

    You can use xxd:

    $cat hex.txt
    68 65 6c 6c 6f
    $cat hex.txt | xxd -r -p
    hello
    

提交回复
热议问题