is there any linux command line tool to cat any file's content which may be mixed with UTF-8 string and non-printable chars, but also show non-printable chars as \xNN?
such as abc\xa1defg
,
PS: I don't need the two column output like xxd produces, or the the space separated output that od
produces.
So far, the most close result is: od -t c FILE
0000000 S Q L i t e f o r m a t 3 \0
0000020 020 \0 \n \t \0 \0 \0 \0 \0 \0 \0 001 \0 \0 \0 004
0000040 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 001 \0 \0 \0 004
But what I want is is like this
SQLite format 3\0\020\0
\0\0.....
Found a similar question: https://unix.stackexchange.com/questions/176111/how-to-dump-a-binary-file-as-a-c-c-string-literal