Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Tips] How to remove control characters from terminal recording (i.e. by script command)

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
Aki
Global Moderator
Global Moderator
Posts: 3103
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 77 times
Been thanked: 419 times

[Tips] How to remove control characters from terminal recording (i.e. by script command)

#1 Post by Aki »

Hello,

Just a tip on how to remove control characters from terminal logs (i.e. generated with the script [1] command).

The ansi2txt program is required (from the colorized-logs package [2]).

You can use the following command [3] where log.txt is the log generated by the script command (or similar commands):

Code: Select all

cat log.txt | ansi2txt | col -b > log-cleared.txt
Hope this helps.

--
[1] SCRIPT(1)
[2] colorized-logs
[3] Removing control chars (including console codes / colours) from script output
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply