Grepping non printable characters doesn’t seem to work for carriage return (control key ^M).
usr@R923047 ~
$ head -3 test.ctl
row 1
row 2
row 3
usr@R923047 ~
$ head -3 test.ctl | cat -nv
1 row 1^M
2 row 2^M
3 row 3
usr@R923047 ~
$ head -3 test.ctl | grep '[^[:print:]]'
usr@R923047 ~
$ head -3 test.ctl | grep '[[:cntrl:]]'
usr@R923047 ~
According to the
grepman-page, you can specify-Uor--binaryto:So: