File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
10
10
11
11
For a steady stream of TILs, [ sign up for my newsletter] ( https://tinyletter.com/jbranchaud ) .
12
12
13
- _ 1034 TILs and counting..._
13
+ _ 1035 TILs and counting..._
14
14
15
15
---
16
16
@@ -1011,6 +1011,7 @@ _1034 TILs and counting..._
1011
1011
- [ Show A File Preview When Searching With FZF] ( unix/show-a-file-preview-when-searching-with-fzf.md )
1012
1012
- [ Show Disk Usage For The Current Directory] ( unix/show-disk-usage-for-the-current-directory.md )
1013
1013
- [ Show The Size Of Everything In A Directory] ( unix/show-the-size-of-everything-in-a-directory.md )
1014
+ - [ Skip Paging If Output Fits On Screen With Less] ( unix/skip-paging-if-output-fits-on-screen-with-less.md )
1014
1015
- [ SSH Escape Sequences] ( unix/ssh-escape-sequences.md )
1015
1016
- [ SSH With Port Forwarding] ( unix/ssh-with-port-forwarding.md )
1016
1017
- [ Specify The Language For A File With Bat] ( unix/specify-the-language-for-a-file-with-bat.md )
Original file line number Diff line number Diff line change
1
+ # Skip Paging If Output Fits On Screen With Less
2
+
3
+ The ` less ` command can be used to display a file or the output of a command. It
4
+ is sometimes referred to as a pager because it paginates text that won't fit
5
+ onto a single screen.
6
+
7
+ ``` bash
8
+ $ ls | less
9
+ ```
10
+
11
+ This will list the files for the current directory with ` less ` .
12
+
13
+ By default it will even display a small amount of text output within the pager.
14
+ If you want ` less ` to output text that fits onto a single screen directly to
15
+ the terminal, you can pass the ` -F ` and ` -X ` flags.
16
+
17
+ ``` bash
18
+ $ ls | less -FX
19
+ ```
20
+
21
+ The ` -F ` flag tells ` less ` to exit if the output fits onto a single screen. The
22
+ ` -X ` tells ` less ` to skip screen clearing.
23
+
24
+ This is handy if you want the output of a command to show up in your shell
25
+ history.
26
+
27
+ See ` man less ` for more details.
You can’t perform that action at this time.
0 commit comments