Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Linux's shell output to HTML?

Tags:

html

linux

shell

Is there any easy way to convert bash output to HTML? For example, if I have some colorized output in bash (something like htop), how can I convert it to HTML, with corresponding stylings/tags/css/etc.

like image 364
Michel Gokan Khan Avatar asked Jan 09 '10 12:01

Michel Gokan Khan


People also ask

How do I convert a TXT file to HTML in Linux?

To convert a text file, open the directory of the file in the terminal. Right-click on the directory and choose "Open in terminal". The '-extract' option specifies NOT to put HTML headers or footers on the result, just the plain HTML text with paragraph tags.

What does $() mean in shell script?

$() – the command substitution. ${} – the parameter substitution/variable expansion.

How do I save a bash output to a file?

To use bash redirection, you run a command, specify the > or >> operator, and then provide the path of a file you want the output redirected to. > redirects the output of a command to a file, replacing the existing contents of the file.


1 Answers

There's ansifilter plus some tools like highlight will produce colorized html from plain text such as source files.

Both available here.

like image 195
Dennis Williamson Avatar answered Oct 13 '22 18:10

Dennis Williamson