Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • hello , thank for your answer but in the output it's give me "[@ ~]# [[[[[[[[ [[[[[[[[[[[" i want to have the output without the hidden characters . Commented May 20, 2019 at 12:30
  • You have not tried out your answer. Try it against the output of printf '[root@localhost ~]# ls \b\e[K\b\e[[K\b\e[Kpwd\b\e[K\b\e[K\b\e[K' to see how wrong it goes. Commented May 20, 2019 at 12:31
  • Ah, you also want to remove escape sequences in addition to non-printing characters. A second sed will accomplish that. I'll edit my answer... Commented May 20, 2019 at 12:33
  • ... or nm, see the post JdeBP linked in the comment to the main question. Commented May 20, 2019 at 12:34