1BAT(1) General Commands Manual BAT(1)
2
3
4
6 bat - manual page for bat
7
9 bat - a cat(1) clone with syntax highlighting and Git integration.
10
12 bat [OPTIONS] [FILE]...
13
14 bat <SUBCOMMAND>
15
17 General remarks
18
19 Command-line options like '-l'/'--language' that take values can
20 be specified as either '--language value', '--language=value',
21 '-l value' or '-lvalue'.
22
23 -l, --language <language>
24
25 Explicitly set the language for syntax highlighting. The lan‐
26 guage can be specified as a name (like 'C++' or 'LaTeX') or pos‐
27 sible file extension (like 'cpp', 'hpp' or 'md'). Use
28 '--list-languages' to show all supported language names and file
29 extensions.
30
31 -L, --list-languages
32
33 Display a list of supported languages for syntax highlighting.
34
35 -m, --map-syntax <from:to>...
36
37 Map a file extension or file name to an existing syntax. For
38 example, to highlight *.conf files with the INI syntax, use '-m
39 conf:ini'. To highlight files named '.myignore' with the Git
40 Ignore syntax, use '-m .myignore:gitignore'.
41
42 --theme <theme>
43
44 Set the theme for syntax highlighting. Use '--list-themes' to
45 see all available themes. To set a default theme, add the
46 '--theme="..."' option to the configuration file or export the
47 BAT_THEME environment variable (e.g.: export BAT_THEME="...").
48
49 --list-themes
50
51 Display a list of supported themes for syntax highlighting.
52
53 --style <style-components>
54
55 Configure which elements (line numbers, file headers, grid bor‐
56 ders, Git modifications, ..) to display in addition to the file
57 contents. The argument is a comma-separated list of components
58 to display (e.g. 'numbers,changes,grid') or a pre-defined style
59 ('full'). To set a default style, add the '--style=".."' option
60 to the configuration file or export the BAT_STYLE environment
61 variable (e.g.: export BAT_STYLE=".."). Possible values: *auto*,
62 full, plain, changes, header, grid, numbers, snip.
63
64 -p, --plain
65
66 Only show plain style, no decorations. This is an alias for
67 '--style=plain'. When '-p' is used twice ('-pp'), it also dis‐
68 ables automatic paging (alias for '--style=plain
69 --pager=never').
70
71 -n, --number
72
73 Only show line numbers, no other decorations. This is an alias
74 for '--style=numbers'
75
76 -A, --show-all
77
78 Show non-printable characters like space, tab or newline. Use
79 '--tabs' to control the width of the tab-placeholders.
80
81 -r, --line-range <N:M>...
82
83 Only print the specified range of lines for each file. For exam‐
84 ple:
85
86 --line-range 30:40
87 prints lines 30 to 40
88
89 --line-range :40
90 prints lines 1 to 40
91
92 --line-range 40:
93 prints lines 40 to the end of the file
94
95 -H, --highlight-line <N>...
96
97 Highlight the N-th line with a different background color
98
99 --color <when>
100
101 Specify when to use colored output. The automatic mode only
102 enables colors if an interactive terminal is detected. Possible
103 values: *auto*, never, always.
104
105 --italic-text <when>
106
107 Specify when to use ANSI sequences for italic text in the out‐
108 put. Possible values: always, *never*.
109
110 --decorations <when>
111
112 Specify when to use the decorations that have been specified via
113 '--style'. The automatic mode only enables decorations if an
114 interactive terminal is detected. Possible values: *auto*,
115 never, always.
116
117 --paging <when>
118
119 Specify when to use the pager. To control which pager is used,
120 set the PAGER or BAT_PAGER environment variables (the latter
121 takes precedence) or use the '--pager' option. To disable the
122 pager permanently, set BAT_PAGER to an empty string or set
123 '--paging=never' in the configuration file. Possible values:
124 *auto*, never, always.
125
126 --pager <command>
127
128 Determine which pager is used. This option will overwrite the
129 PAGER and BAT_PAGER environment variables. The default pager is
130 'less'. To disable the pager completely, use the '--paging'
131 option. Example: '--pager "less -RF"'.
132
133 --wrap <mode>
134
135 Specify the text-wrapping mode (*auto*, never, character). The
136 '--terminal-width' option can be used in addition to control the
137 output width.
138
139 --tabs <T>
140
141 Set the tab width to T spaces. Use a width of 0 to pass tabs
142 through directly
143
144 -u, --unbuffered
145
146 This option exists for POSIX-compliance reasons ('u' is for
147 'unbuffered'). The output is always unbuffered - this option is
148 simply ignored.
149
150 --terminal-width <width>
151
152 Explicitly set the width of the terminal instead of determining
153 it automatically. If prefixed with '+' or '-', the value will be
154 treated as an offset to the actual terminal width. See also:
155 '--wrap'.
156
157 -h, --help
158
159 Print this help message.
160
161 -V, --version
162
163 Show version information.
164
166 <FILE>...
167
168 File(s) to print / concatenate. Use a dash ('-') or no argument
169 at all to read from standard input.
170
172 cache Modify the syntax-definition and theme cache
173
174
175
176 BAT(1)