4

I want to do a full screen copy of some terminal output, with ANSI colors, and generate HTML so I can post to a blog or wiki.

My real world example: I want to document top with all of its ANSI color goodness. (I'd rather not do a bitmap screenshot. Text is more efficient.) Ideas?

David J.
  • 199
  • 1
  • 6

1 Answers1

5

I got this idea from: http://www.linuxquestions.org/questions/linux-desktop-74/preserve-colors-when-copy-pasting-from-terminal-943213/

sudo apt-get install aha
timestamp=$(date +%Y%m%d-%H%M%S)
top -n 1 | aha > top-$timestamp.html
David J.
  • 199
  • 1
  • 6
  • Very nice, thanks! On RHEL/CentOS you can get the package from fedoraproject.org. For example: `sudo yum install http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/a/aha-0.5-1.el7.x86_64.rpm` – Noam Manos Feb 13 '20 at 06:43