You can use grep's -a (--text) option to if you want to match null bytes.
This is documented behavior; the grep manual says that when grep is reading a
binary file it "may treat non-text bytes as line terminators".
- bug#36820: grep "[[:cntrl:]]" /proc/1/cmdline works ... Jeff Chua
- bug#36820: grep "[[:cntrl:]]" /proc/1/cmdline w... Paul Eggert
- bug#36820: grep "[[:cntrl:]]" /proc/1/cmdli... Jeff Chua
- bug#36820: grep "[[:cntrl:]]" /proc/1/c... Paul Eggert
- bug#36820: grep "[[:cntrl:]]" /proc... Jeff Chua