When I use some command in bash like npm audit, I can see the output with some colored text. I want to save the output with colored text preserved. I have tried selecting the text and saving in LibreOffice document but it saves text without any formatting.

Is there any way to save the output with colored text preserved?


Use a terminal emulator which supports copying the text as HTML (or similar). You can paste it either directly to a .html file, or to LibreOffice which will import the formatting.

For example, GNOME Terminal has a "Copy as HTML" menu item as of v3.26 (libvte 0.50).

  • I am using GNOME terminal 3.18.3 in Ubuntu 16.04. I will have to either update Ubuntu or use unofficial repo to use the new version of GNOME terminal. Can you suggest other terminal emulator with such feature? – Barun Oct 9 '18 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.