1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00
Files
til/unix/print-a-range-of-lines-for-a-file-with-bat.md

664 B

Print A Range Of Lines For A File With Bat

I recently learned about a faster and more colorful alternative to cat -- bat. Like cat, the standard usage is to print the entire contents of a file. You can instruct bat to only print a range of lines from a file using the --line-range flag.

For instance the following command

$ bat --line-range=918:925 README.md

will produce the following output

a range of lines from the README

See man bat for more details.