Skip to main content
3 of 3
edited tags
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k

How to remove junk characters from the file generated by script command in linux

I am using script command to record everything from terminal. But when I am opening the generated file its having lots of junk character. Can anyone help me to remove these junk characters from file or any other alternate way?

This file look like this:

ossvm10(0)> ls -lrt /usr/opt/temip/mmexe/mcc_fcl_pm.exe^M
^[[00m-rwxr-xr-x 1 root root 387517 Feb 18  2013 ^[[00;32m/usr/opt/temip/mmexe/mcc_fcl_pm.exe^[[00m^M
^[[m^[]0;temip@ossvm10:/home/dharmc^G[/home/dharmc]^M
ossvm10(0)> script -a unit_testing_TEMIPTFRLIN_00202_CR#9961.txtsum /usr/opt/temip/mmexe/mcc_fcl_pm.exe^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^[[1P^H^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^H^[[1P^[[1P^H^G^G^G^G^G^G^G^G^M
06046   379^M
^[]0;temip@ossvm10:/home/dharmc^G[/home/dharmc]^M
dcds
  • 1.1k
  • 4
  • 14
  • 23