Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-26-2013, 01:31 PM   #1
LQ Newbie
Registered: Feb 2013
Posts: 2

Rep: Reputation: Disabled
Remove control characters in Script output

I'm using the "script" command to log my entries and activities in Linux.

All is going well, but it's capturing the control characters too, which is fine for displaying it back in the terminal.

However when I come to edit the text, these are all present and it ruins the formatting.

Is there a way to remove them for text editing? Thanks.

Example output (characters highlighted)...

Script started on Tue 26 Feb 2013 06:09:26 PM UTC
pc3:~# hostname
pc3:~# ls
pc3:~# ls /hosthome/ -l
total 56
drwxr-xr-x 2 guest guest 4096 2013-01-22 11:46 Desktop
drwxr-xr-x 2 guest guest 4096 2013-01-16 16:36 Documents
pc3:~# exit
Old 02-26-2013, 03:34 PM   #2
Senior Member
Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,742

Rep: Reputation: 599Reputation: 599Reputation: 599Reputation: 599Reputation: 599Reputation: 599
Google may provide the advice you seek.
Do a Google search on the title of this thread ...
Remove control characters in Script output
... and you will find plenty of relevant pages.

Daniel B. Martin
Old 02-26-2013, 04:05 PM   #3
LQ Newbie
Registered: Feb 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks, I think I found the tr command - but as usual with Google there was a load of irrelevant dross, hence why I found this forum!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Control Characters from a File NeonFlash Linux - Newbie 3 02-04-2013 10:24 PM
How to remove ^L control characters from text files? bashari Linux - Newbie 2 09-12-2012 12:36 PM
[SOLVED] Remove characters from grep output intz Programming 9 05-04-2010 07:03 AM
[SOLVED] Saving output without control characters damianpfister Linux - General 7 07-30-2009 05:34 AM
How to remove decoration characters from GCC output? Programming 2 11-27-2007 10:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration