From 89f368dfb6cd9ddc95418fc684f096cfacb20911 Mon Sep 17 00:00:00 2001 From: Vitor Henrique <87824454+vitorhcl@users.noreply.github.com> Date: Sun, 4 Feb 2024 13:06:50 -0300 Subject: [PATCH] look: add page (#12159) * look: add page --------- Co-authored-by: K.B.Dharun Krishna --- pages/common/look.md | 22 ++++++++++++++++++++++ pages/freebsd/look.md | 21 +++++++++++++++++++++ pages/linux/look.md | 26 ++++++++++++++++++++++++++ pages/osx/look.md | 17 +++++++++++++---- 4 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 pages/common/look.md create mode 100644 pages/freebsd/look.md create mode 100644 pages/linux/look.md diff --git a/pages/common/look.md b/pages/common/look.md new file mode 100644 index 000000000..4ab762250 --- /dev/null +++ b/pages/common/look.md @@ -0,0 +1,22 @@ +# look + +> Display lines beginning with a prefix in a sorted file. +> NOTE: the lines in the file must be sorted. +> See also: `grep`, `sort`. +> More information: . + +- Search for lines beginning with a specific prefix in a specific file: + +`look {{prefix}} {{path/to/file}}` + +- Case-insensitively ([f]) search only on alphanumeric characters ([d]): + +`look -f -d {{prefix}} {{path/to/file}}` + +- Specify a string [t]ermination character (space by default): + +`look -t {{,}}` + +- Search in `/usr/share/dict/words` (`-d` and `-f` are assumed): + +`look {{prefix}}` diff --git a/pages/freebsd/look.md b/pages/freebsd/look.md new file mode 100644 index 000000000..fb46deba0 --- /dev/null +++ b/pages/freebsd/look.md @@ -0,0 +1,21 @@ +# look + +> Display lines beginning with a prefix in a sorted file. +> See also: `grep`, `sort`. +> More information: . + +- Search for lines beginning with a specific prefix in a specific file: + +`look {{prefix}} {{path/to/file}}` + +- Case-insensitively search only on alphanumeric characters: + +`look -{{f|-ignore-case}} -{{d|-alphanum}} {{prefix}} {{path/to/file}}` + +- Specify a string [t]ermination character (space by default): + +`look -{{t|-terminate}} {{,}}` + +- Search in `/usr/share/dict/words` (`--ignore-case` and `--alphanum` are assumed): + +`look {{prefix}}` diff --git a/pages/linux/look.md b/pages/linux/look.md new file mode 100644 index 000000000..07db8ff26 --- /dev/null +++ b/pages/linux/look.md @@ -0,0 +1,26 @@ +# look + +> Display lines beginning with a prefix in a file. +> NOTE: the lines in the file must be sorted. +> See also: `grep`, `sort`. +> More information: . + +- Search for lines beginning with a specific prefix in a specific file: + +`look {{prefix}} {{path/to/file}}` + +- Case-insensitively search only on blank and alphanumeric characters: + +`look -{{f|-ignore-case}} -{{d|-alphanum}} {{prefix}} {{path/to/file}}` + +- Specify a string [t]ermination character (space by default): + +`look -{t|-terminate} {{,}}` + +- Search in `/usr/share/dict/words` (`--ignore-case` and `--alphanum` are assumed): + +`look {{prefix}}` + +- Search in `/usr/share/dict/web2` (`--ignore-case` and `--alphanum` are assumed): + +`look -{{a|-alternative}} {{prefix}}` diff --git a/pages/osx/look.md b/pages/osx/look.md index 681f37071..68ccf72af 100644 --- a/pages/osx/look.md +++ b/pages/osx/look.md @@ -1,12 +1,21 @@ # look -> Look for lines in sorted file. +> Display lines beginning with a prefix in a sorted file. +> See also: `grep`, `sort`. > More information: . -- Look for lines which begins with the given prefix: +- Search for lines beginning with a specific prefix in a specific file: `look {{prefix}} {{path/to/file}}` -- Look for lines ignoring case: +- Case-insensitively search only on alphanumeric characters: -`look --ignore-case {{prefix}} {{path/to/file}}` +`look -{{f|-ignore-case}} -{{d|-alphanum}} {{prefix}} {{path/to/file}}` + +- Specify a string [t]ermination character (space by default): + +`look -{{t|-terminate}} {{,}}` + +- Search in `/usr/share/dict/words` (`--ignore-case` and `--alphanum` are assumed): + +`look {{prefix}}`