Command-line tool that converts text containing ANSI control codes into plain ASCII text. It works as a filter, reading from stdin or a file, removing all ANSI codes, and sending the output to stdout.
This repo was inspired by kilobyte/colorized-logs.
Click to expand
-
If you don't have it already, install the
ca-certificatespackagesudo apt install ca-certificates
-
Add gabe565 apt repository
echo 'deb [trusted=yes] https://apt.gabe565.com /' | sudo tee /etc/apt/sources.list.d/gabe565.list -
Update apt repositories
sudo apt update
-
Install ansi2txt
sudo apt install ansi2txt
Click to expand
-
If you don't have it already, install the
ca-certificatespackagesudo dnf install ca-certificates
-
Add gabe565 rpm repository to
/etc/yum.repos.d/gabe565.repo[gabe565] name=gabe565 baseurl=https://rpm.gabe565.com enabled=1 gpgcheck=0
-
Install ansi2txt
sudo dnf install ansi2txt
Click to expand
Install ansi2txt-bin with your AUR helper of choice.
Click to expand
- Download and run the latest release binary for your system and architecture.
- Extract the binary and place it in the desired directory.
If ansi2txt is run with no arguments, it will read data from stdin, filter control codes, and write to stdout. A filename argument can also be provided to filter the file's contents to stdout.
- Read data from stdin:
ls --color=always | ansi2txt - Read data from a file:
ansi2txt example.txt