diff options
author | Peter Elliott <pelliott@ualberta.ca> | 2021-07-06 19:47:00 -0600 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-07 20:01:15 +0430 |
commit | 9b40208e3bc4b68ffbb03ae4d8be4cea4bda1136 (patch) | |
tree | 0bb4e2ac07a3d7a65e4c2c27db574a57a7e12bd0 /Base/usr/share/man | |
parent | a11658737a292d0dbbbb13feb9c83f99c5773546 (diff) | |
download | serenity-9b40208e3bc4b68ffbb03ae4d8be4cea4bda1136.zip |
Documentation: Add less(1) man page, and link to it in others
Diffstat (limited to 'Base/usr/share/man')
-rw-r--r-- | Base/usr/share/man/man1/less.md | 78 | ||||
-rw-r--r-- | Base/usr/share/man/man1/man.md | 4 | ||||
-rw-r--r-- | Base/usr/share/man/man1/more.md | 7 |
3 files changed, 88 insertions, 1 deletions
diff --git a/Base/usr/share/man/man1/less.md b/Base/usr/share/man/man1/less.md new file mode 100644 index 0000000000..99f0b50bb9 --- /dev/null +++ b/Base/usr/share/man/man1/less.md @@ -0,0 +1,78 @@ +## Name + +`less` - A full-featured terminal pager. + +## Synopsis + +```**sh +$ cat file | less [-PXem] +$ less [-PXem] [file] +$ cat file | more +$ more [file] +``` + +## Description + +`less` is a terminal pager that allows backwards movement. It is inspired by, +but largely incompatible with +[GNU less](http://www.greenwoodsoftware.com/less/index.html). + +## Options + +* `-P`, `--prompt`: Set the prompt format string. See [Prompts](#Prompts) for more details. +* `-X`, `--no-init`: Don't switch to the xterm alternate buffer on startup. +* `-e`, `--quit-at-eof`: Immediately exit less when the last line of the document is reached. +* `-m`, `--emulate-more`: Apply `-Xe`, set the prompt to `--More--`, and disable + scrollback. This option is automatically applied when `less` is executed as `more` + +## Commands + +Commands may be preceded by a decimal number `N`. Currently, this feature +does not exist, and no command use `N`. + +| Command | Description | +|---------|-------------| +| `q` | Exit less. | +| `j` or `DOWNARROW` or `ENTER` | Go to the next line. | +| `k` or `UPARROW` | Go to the previous line. | +| `SPACE` | Go to the next page. | + +## Prompts + +`less` accepts a special prompt string with the `-P` option. prompts accept a +variety of format specifiers so that they adapt to `less`'s state. + +A `%` followed by a letter will be replaced with the associated variable. If +such a variable does not exist, or currently has no value, it will be replaced +with a `?`. + +| Variable | Description | +|----------|-------------| +| `%f` | Replaced with the name of the current file | +| `%l` | Replaced with the current line number | + +A `?` followed by a letter acts as an if expression on the associated +condition. `:` then acts as the else, and `.` acts as the end token. for example +if you wanted to print 'true' if you are at the end of the file and 'false' +otherwise, your prompt would be `?etrue:false.`. These expressions are +arbitrarily nestable. If a condition does not exist, then it will always +evaluate it's false branch. + +| Condition | Description | +|----------|-------------| +| `?f` | True when reading from a file other than stdin. | +| `?e` | True when at the end of a file. | + +A `\\` followed by any character will be replaced with the literal value of the +character. For instance, `\\%l` would render as `%l`. + +All other characters are treated normally. + +#### examples + +`less`'s current default prompt: `'?f%f :.(line %l)?e (END):.'` + +## See Also + +* [more(1)](more.md) For a simpler pager that less implements. +* [man(1)](man.md) For serenity's manual pager, that uses less. diff --git a/Base/usr/share/man/man1/man.md b/Base/usr/share/man/man1/man.md index a151b71c18..bcb6bab69e 100644 --- a/Base/usr/share/man/man1/man.md +++ b/Base/usr/share/man/man1/man.md @@ -50,3 +50,7 @@ $ man 2 mkdir `man` looks for man pages under `/usr/share/man`. For example, this man page should be located at `/usr/share/man/man1/man.md`. + +## See Also + +* [less(1)](less.md) For the terminal pager that `man` uses by default
\ No newline at end of file diff --git a/Base/usr/share/man/man1/more.md b/Base/usr/share/man/man1/more.md index 0df00cb809..cd9f1b599e 100644 --- a/Base/usr/share/man/man1/more.md +++ b/Base/usr/share/man/man1/more.md @@ -11,11 +11,16 @@ $ more ## Description `more` reads data from standard input and prints it to standard output, screen by screen. +`more` is a symlink for [`less(1)`](less.md), which has a more emulation mode. ## Examples ```sh # dmesg | more ... ---[ more ]-- +--More-- ``` + +## See Also + +* [less(1)](less.md) For the more advanced terminal pager that implements more.
\ No newline at end of file |