Skip to main content
1 of 3
Kusalananda
  • 355.9k
  • 42
  • 735
  • 1.1k

The Ctrl+Z is \032 in octal. This can be deleted by tr:

tr -d '\032' <file >newfile

This deletes the characters anywhere in the file and creates a new file called newfile with the modified contents.


Your sed command does not work as the expression ^Z would match a Z character at the start of the line.

Kusalananda
  • 355.9k
  • 42
  • 735
  • 1.1k