Bat is an useful tool for viewing plain text files in the terminal.
The official repository can be found here. This repository serves as a easy-to-do tutorial for setting up bat.
Install Visual C++ Redistributable first.
Then there are many package managers that can be used to install bat on Windows, such as scoop, chocolatey, winget, etc.
At the same time, installation via binary files is also supported. See Release.
scoop install bat
scoop install lesschoco install batwinget install sharkdp.bat
winget install JohnTaylor.less
winget install JohnTaylor.lesskeybrew install batport install batsudo apt install batIf you install bat this way, please note that the executable may be installed as batcat instead of bat (due to a name clash with another package). You can set up a bat -> batcat symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:
mkdir -p ~/.local/bin
ln -s /usr/bin/batcat ~/.local/bin/batBat can also be installed using .deb files, see official repository for more information.
sudo apk add batsudo pacman -S batOther distributions please refer to the official repository.
The configuration file's location can be called using bat --config-file. A default configuration file can be generated using bat --generate-config-file.
Run bat --help to see all the available options.
For Windows users, some features need extra configuration. See official repository if errors occur.
This repo contains sample config file for bat.
git clone https://github.com/Hydraallen/bat.git ~/.config/batbat filenameYou can use the -A/--show-all option to show and highlight non-printable characters.