From 29dc3ba824c08699e669b191757cfc230a0747d2 Mon Sep 17 00:00:00 2001 From: Chris Jesz Date: Wed, 28 Nov 2018 21:44:59 -0500 Subject: [PATCH] Created bash less page (#22912) * Created bash less page Created file/folder for bash less command along with brief explanation, examples, and links to further information. * Corrected mistake Corrected a mistake in the options section for exiting less. Mistakenly has ctrl^c as the exit instead of q * fix(guide): minor typo corrections --- guide/english/bash/bash-less/index.md | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 guide/english/bash/bash-less/index.md diff --git a/guide/english/bash/bash-less/index.md b/guide/english/bash/bash-less/index.md new file mode 100644 index 0000000000..c38ba8c65e --- /dev/null +++ b/guide/english/bash/bash-less/index.md @@ -0,0 +1,31 @@ +--- +title: Bash Less +--- + ## Bash command: less + The `less` command is a way to easily view files. Similar to the `more` command but with easier navigation. + + ### Usage + ``` + less + ``` + + Commonly used options: + * Typically less is used with no options + + ### Examples + #### View the /etc/hosts file + ```bash + less /etc/hosts + ``` + + ### Options used while viewing a file + * `q` - Exit viewing. + * `shift^g` - Navigate to the bottom of the file. + * `g` - Navigate to the top of the file. + * `/` - Search down from current screen. Note you have to type some text and hit enter to complete the search. + * `?` - Search up from current screen. + * `n` - Used while searching to go to the next result. This works while searching up and down the file. + + ### More Information + * Run `man less` for further details on the less command. + * [Wikipedia](https://en.wikipedia.org/wiki/Less_(Unix))