2013-12-08 08:56:16 +00:00
|
|
|
# less
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Opens a file for reading.
|
|
|
|
> Allows movement and search.
|
|
|
|
> Doesn't read the entire file (suitable for logs).
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Open a file:
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2013-12-09 11:12:16 +00:00
|
|
|
`less {{source_file}}`
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Page up / down:
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2016-09-05 18:27:12 +01:00
|
|
|
`<Space> (next), b (previous)`
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Go to start / end of file:
|
2013-12-08 08:56:16 +00:00
|
|
|
|
|
|
|
`g (start), G (end)`
|
|
|
|
|
2016-03-04 10:33:57 +00:00
|
|
|
- Forward search for a string:
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2013-12-09 11:12:16 +00:00
|
|
|
`/{{something}} then n (next), N (previous)`
|
2013-12-08 08:56:16 +00:00
|
|
|
|
2016-03-04 10:33:57 +00:00
|
|
|
- Backward search for a string:
|
|
|
|
|
|
|
|
`?{{something}} then n (next), N (previous)`
|
|
|
|
|
2016-05-12 10:49:04 +01:00
|
|
|
- Enable output of ANSI colors:
|
|
|
|
|
|
|
|
`git diff --color | less -R`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Exit:
|
2013-12-08 08:56:16 +00:00
|
|
|
|
|
|
|
`q`
|