Giter VIP home page Giter VIP logo

bat's Introduction

bat

Bat is an useful tool for viewing plain text files in the terminal.

Reference

The official repository can be found here. This repository serves as a easy-to-do tutorial for setting up bat.

Installation

Windows

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

scoop install bat
scoop install less

Chocolatey

choco install bat

Winget

winget install sharkdp.bat
winget install JohnTaylor.less
winget install JohnTaylor.lesskey

macOS (with brew or MacPorts)

brew install bat
port install bat

Linux

Ubuntu and other Debian-based Linux distributions (with apt)

sudo apt install bat

If 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/bat

Bat can also be installed using .deb files, see official repository for more information.

Alpine Linux

sudo apk add bat

Arch Linux

sudo pacman -S bat

Other distributions please refer to the official repository.

Configuration

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.

Sample

This repo contains sample config file for bat.

git clone https://github.com/Hydraallen/bat.git ~/.config/bat

Usage

Display a single file on the terminal

bat filename

Show non-printable characters

You can use the -A/--show-all option to show and highlight non-printable characters.

Star History

Star History Chart

bat's People

Contributors

hydraallen avatar mqzljp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.