Bat es un cat enriquecido. Lo veo un poco como una mezcla de cat + less.
Permite el resaltado de sintaxis de una gran cantidad de lenguajes de programación y marcado, entre ellos el orgmode, csv, markdown, html, bash, python, ...
Muestra caracteres no imprimibles, canaliza su propia salida a less cuando la salida es demasiado grande para una pantalla. También se integra con git.
Descargamos el paquete .deb
wget https://github.com/sharkdp/bat/releases/download/v0.12.1/bat_0.12.1_armhf.deb
Instalamos
sudo dpkg -i bat_0.12.1_armhf.deb
Descargamos el paquete .deb
wget https://github.com/sharkdp/bat/releases/download/v0.12.1/bat_0.12.1_amd64.deb
Instalamos
sudo dpkg -i bat_0.12.1_armhf.deb
Para Mac, windows,... encontrarás el resto de instalaciones en su repositorio en GitHub.
El funcionamiento es exactamente igual que cat
bat README.md
bat archivo1 archivo2
Utilizando la opción -A/ --show-all muestra y resalta caracteres no imprimibles.
bat -A archivo.org
Igual que muchas aplicaciones cli, inspiradas en vi, para salir de la visualización de un archivo muy largo, pulsaremos la tecla q.
Estas son las opciones que muestra bat --help.
A cat(1) clone with syntax highlighting and Git integration.
USAGE:
bat [OPTIONS] [FILE]...
bat <SUBCOMMAND>
OPTIONS:
-l, --language <language> Set the language for syntax highlighting.
-L, --list-languages Display all supported languages.
-m, --map-syntax <from:to>... Map a file extension or name to an existing syntax.
--theme <theme> Set the color theme for syntax highlighting.
--list-themes Display all supported highlighting themes.
--style <style-components> Comma-separated list of style elements to display (*auto*,
full, plain, changes, header, grid, numbers, snip).
-p, --plain Show plain style (alias for '--style=plain').
-n, --number Show line numbers (alias for '--style=numbers').
-A, --show-all Show non-printable characters (space, tab, newline, ..).
-r, --line-range <N:M>... Only print the lines from N to M.
-H, --highlight-line <N>... Highlight the given line.
--color <when> When to use colors (*auto*, never, always).
--italic-text <when> Use italics in output (always, *never*)
--decorations <when> When to show the decorations (*auto*, never, always).
--paging <when> Specify when to use the pager (*auto*, never, always).
--wrap <mode> Specify the text-wrapping mode (*auto*, never, character).
--tabs <T> Set the tab width to T spaces.
-h, --help Print this help message.
-V, --version Show version information.
ARGS:
<FILE>... File(s) to print / concatenate. Use '-' for standard input.
SUBCOMMANDS:
cache Modify the syntax-definition and theme cache
Te animo a visitar el repositorio de GitHub para ver la documentación y encontrar la utilidad más adaptada a tí.
Publicado por Angel el Saturday 04 January del 2020
También te puede interesar:
Powered by org-bash-blog
Written in OrgMode with Emacs and converted to HTML with Pandoc

Este obra está bajo una licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional.