I want to delete all the control characters from my file using linux bash commands.
There are some control characters like EOF (0x1A) especially which are causing th
Instead of using the predefined [:cntrl:] set, which as you observed includes \n and \r, just list (in octal) the control characters you want to get rid of:
[:cntrl:]
\n
\r
$ tr -d '\000-\011\013\014\016-\037' < file.txt > newfile.txt