ansifilter(1)
โจ NAME โจ
Okay bestie, let's talk about ansifilter ๐
Ansifilter is an ANSI escape code processor and converter ๐
๐ฆ SYNOPSIS ๐ฆ
ansifilter [d:i:F:m:o:r:s:e:fhptvHRT] [-i input file] [-o output file]
[--text] [--html] [--latex] [--tex] [--rtf] [input files]
๐ธ DESCRIPTION ๐ธ
Okay so, Ansifilter is a small utility that handles text files full of ANSI terminal escape codes ๐ง The command sequences can either get stripped out or get interpreted to make formatted output (HTML, LaTeX, TeX, RTF). Iconic.
See the README file for details ๐
๐ File options ๐
-i,--input=<file>(default stdin) โ the name of your input file ๐ฅ-o,--output=<file>(default stdout) โ the name of your output file ๐ค-O,--outdir=<dir>โ the name of your output directory ๐-t,--tailโ keeps reading after end-of-file, kinda liketail -f. It'll use the systemtailif one is available โณ-x,--max-size=<size>โ sets the max input file size (examples:512M,1G; default:256M) ๐-n,--teeโ copies stdin to stdout and writes the filtered output to a file too ๐ฏ-b,--appendโ appends to the output file (use with--tee) โ
๐ Output formats ๐
-T,--textโ plain text output (default) ๐-H,--htmlโ HTML output ๐-M,--pangoโ Pango markup output ๐จ-L,--latexโ LaTeX output ๐งฎ-P,--texโ Plain TeX output ๐-R,--rtfโ RTF output ๐-B,--bbcodeโ BBCode output ๐ฌ-S,--svgโ SVG output โจ
๐ Format options ๐
-a,--anchors(=self)โ adds HTML line anchors (opt: self referencing, assumes-l) โ-d,--doc-titleโ sets the HTML/LaTeX/SVG document title ๐ท๏ธ-f,--fragmentโ leaves out the HTML header and footer โ๏ธ-F,--font=<font>โ sets the HTML/RTF/SVG font face ๐ค-k,--ignore-clear(=false)โ doesn't follow clear (ESC K) commands (default: true). Not me ignoring the clear stuff by default ๐-c,--ignore-csiโ doesn't follow CSI commands (useful for UTF-8 input) ๐ซถ-A,--line-append=<s>โ outputs a string after each output line ๐๏ธ-l,--line-numbersโ prints line numbers in the output file ๐ข-m,--map=<path>โ reads a color mapping file (see README) ๐บ๏ธ-r,--style-ref=<rf>โ sets the HTML/TeX/LaTeX/SVG stylesheet path ๐จ-s,--font-size=<num>โ sets the HTML/RTF/SVG font size ๐-e,--encoding=<enc>โ sets the HTML encoding, which has to match the input file encoding. Omit the encoding info ifenc=NONE๐-p,--plainโ ignores the ANSI formatting info ๐ซฅ-w,--wrap=<len>โ wraps long lines ๐-g,--no-default-fgโ leaves out the default foreground color ๐ฉถ--no-trailing-nlโ leaves out the trailing newline โฉ๏ธ--no-version-infoโ leaves out the version info comment ๐คซ--wrap-no-numbersโ leaves out line numbers on wrapped lines (assumes-l) ๐--derived-stylesโ outputs dynamic stylesheets (HTML/SVG) ๐ช
๐ผ๏ธ ASCII art options ๐ผ๏ธ
--art-cp437โ parses codepage 437 ASCII art (HTML and RTF output) ๐๏ธ--art-binโ parses BIN/XBIN ASCII art (HTML output, no stdin) ๐พ--art-tundraโ parses Tundra ANSI art (HTML output, no stdin) ๐๏ธ--art-widthโ sets the ASCII art width (default 80) โ๏ธ--art-heightโ sets the ASCII art height (default 150) โ๏ธ
โญ OTHER OPTIONS โญ
-h,--helpโ prints help ๐-v,--versionโ prints the version and license info ๐
If no input or output files are specified, stdin and stdout get used for input and output. Plain text gets generated if no output format is given. Parsing XBIN files overrides --art-width, --art-height and --map options.
Heads up, bestie ๐จ The ANSI art file formats BIN, XBIN and TND cannot be read from stdin. Don't try it ๐
๐ Examples ๐
File conversions:
ansifilter -i text_with_ansi.txt -o text_without_ansi.txt
tail -f server.log | ansifilter
ansifilter *.txt
๐ AUTHORS ๐
Andre Simon <a.simon@mailbox.org>
๐ SEE ALSO ๐
More information at http://www.andre-simon.de/.
Andre Simon really ate with this one ๐ Last touched 2025-09-09, and that's the ansifilter(1) era, periodt ๐ซถ๐
๐ฆ where this page comes from
- epel 10: ansifilter 2.24-1.el10_3 ยท GPL-3.0-or-later
- epel 9: ansifilter 2.23-1.el9 ยท GPL-3.0-or-later
- fedora 43: ansifilter 2.23-1.fc43
- fedora 43: ansifilter 2.24-1.fc43 ยท GPL-3.0-or-later
- fedora 44: ansifilter 2.22-3.fc44 ยท GPL-3.0-or-later
- fedora 44: ansifilter 2.23-1.fc44
- fedora 44: ansifilter 2.24-1.fc44 ยท GPL-3.0-or-later
- nixos 26.05: ansifilter 2.22
- nixpkgs unstable: ansifilter 2.24
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms