Thursday 24 May 2018

How to clean up output of linux 'script' command


I'm using the linux 'script' command http://www.linuxcommand.org/man_pages/script1.html to track some interactive sessions. The output files from that contain unprintable characters, including my backspace keystrokes.


Is there a way to tidy these output files up so they only contain what was displayed on screen?


Or is there another way to record an interactive shell session (input and output)?



Answer



If you want to view the file, then you can send the output through col -bp; this interprets the control characters. Then you can pipe through less, if you like.


col -bp typescript | less -R

On some systems col wouldn't accept a filename argument, use this syntax instead:


col -bp 

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...