Saturday, March 25, 2023

Removing Hidden Chars from a File

Removing the garbage characters with the Linux/Unix 'tr' command:

To get the binary characters out of your files, there are several approaches, probably the easiest solution involves using the Linux/Unix 'tr' command. To remove non-printable binary characters (garbage) from a Linux/Unix text file do the following:


tr -cd '\11\12\40-\176' < input.c > output.c

----