File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
10
10
For a steady stream of TILs from a variety of rocketeers, checkout
11
11
[ til.hashrocket.com] ( https://til.hashrocket.com/ ) .
12
12
13
- _ 797 TILs and counting..._
13
+ _ 798 TILs and counting..._
14
14
15
15
---
16
16
@@ -739,6 +739,7 @@ _797 TILs and counting..._
739
739
- [ Open The Current Command In An Editor] ( unix/open-the-current-command-in-an-editor.md )
740
740
- [ Partial String Matching In Bash Scripts] ( unix/partial-string-matching-in-bash-scripts.md )
741
741
- [ PID Of The Current Shell] ( unix/pid-of-the-current-shell.md )
742
+ - [ Print A Range Of Lines For A File With Bat] ( unix/print-a-range-of-lines-for-a-file-with-bat.md )
742
743
- [ Repeat Yourself] ( unix/repeat-yourself.md )
743
744
- [ Saying Yes] ( unix/saying-yes.md )
744
745
- [ Search Files Specific To A Language] ( unix/search-files-specific-to-a-language.md )
Original file line number Diff line number Diff line change
1
+ # Print A Range Of Lines For A File With Bat
2
+
3
+ I recently learned about a [ faster and more colorful alternative to
4
+ cat] ( https://chireviewofbooks.com/2018/12/11/here-are-the-winners-of-the-2018-chicago-review-of-books-awards/ )
5
+ -- [ ` bat ` ] ( https://github.com/sharkdp/bat ) . Like ` cat ` , the standard usage
6
+ is to print the entire contents of a file. You can instruct ` bat ` to only
7
+ print a range of lines from a file using the ` --line-range ` flag.
8
+
9
+ For instance the following command
10
+
11
+ ``` bash
12
+ $ bat --line-range=918:925 README.md
13
+ ```
14
+
15
+ will produce the following output
16
+
17
+ ![ a range of lines from the README] ( https://i.imgur.com/MmKbNvl.png )
18
+
19
+ See ` man bat ` for more details.
You can’t perform that action at this time.
0 commit comments