mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:37:35 +00:00
Base: Update uniq(1) man page
This commit is contained in:
parent
847577bea2
commit
5ff63a9eb0
1 changed files with 28 additions and 7 deletions
|
@ -1,28 +1,49 @@
|
||||||
## Name
|
## Name
|
||||||
|
|
||||||
uniq - filter out repeated lines
|
uniq - filter out repeated adjacent lines
|
||||||
|
|
||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
```**sh
|
```**sh
|
||||||
$ uniq [--version] [INPUT] [OUTPUT]
|
$ uniq [-c] [-d|-u] [-f skip-fields] [-s skip-chars] [--version] [INPUT] [OUTPUT]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
Filter out repeated lines from INPUT (or standard input) and write to OUTPUT (or standard output).
|
Filter out repeated adjacent lines from INPUT (or standard input) and write to OUTPUT (or standard output). It is recommended to sort out the input using [`sort(1)`](help://man/1/sort) beforehand.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
* `--help`: Display help message and exit
|
* `-c`, `--count`: Precede each line with its number of occurrences.
|
||||||
* `--version`: Print version
|
* `-d`, `--repeated`: Only print repeated lines.
|
||||||
|
* `-u`, `--unique`: Only print unique lines (default).
|
||||||
|
* `-f N`, `--skip-fields N`: Skip first N fields of each line before comparing.
|
||||||
|
* `-c N`, `--skip-chars N`: Skip first N chars of each line before comparing.
|
||||||
|
* `--help`: Display help message and exit.
|
||||||
|
* `--version`: Print version.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
Filter out repeated lines from README.md and write to standard output:
|
||||||
```sh
|
```sh
|
||||||
# Filter out repeated lines from README.md and write to standard output
|
|
||||||
$ uniq README.md
|
$ uniq README.md
|
||||||
|
```
|
||||||
|
|
||||||
# Filter out repeated lines from README.md and write to UNIQUE.md
|
Filter out repeated lines from README.md and write to UNIQUE.md:
|
||||||
|
```sh
|
||||||
$ uniq README.md UNIQUE.md
|
$ uniq README.md UNIQUE.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Filter out repeated lines from standard input with their occurrence count:
|
||||||
|
```sh
|
||||||
|
$ echo "Well\nWell\nWell\nHello Friends!" | uniq -c
|
||||||
|
3 Well
|
||||||
|
1 Hello Friends!
|
||||||
|
```
|
||||||
|
|
||||||
|
Filter out repeated lines, ignoring the first field ("XXXX" and "ZZZZ") and the four chars after it (" ABC" and " BCA", thus comparing only the "D"s — which are equal indeed):
|
||||||
|
```sh
|
||||||
|
$ echo "XXXX ABCD\nZZZZ BCAD" | uniq -f1 -s4
|
||||||
|
ZZZZ BCAD
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue