_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

sortusage and examples

-u | unique, suppress duplicate lines.
-h | human numeric sort.
-r | reverse order.
-R | random sort.
-k [N] | sort by field N.
-t [C] | use C as field separator, the default separator is space.

$ cat test
a 1,12
b 3,100
d 2,1
c 10,14
b 3,100
$ cat test | sort -u
a 1,12
b 3,100
c 10,14
d 2,1
$ cat test | sort -u -k2
a 1,12
c 10,14
d 2,1
b 3,100
$ cat test | sort -u -k2 -h
a 1,12
d 2,1
b 3,100
c 10,14
$ cat test | sort -u -k2 -h -t ","
d 2,1
a 1,12
c 10,14
b 3,100
$ cat t | sort -k2 -h -t ","
d 2,1
a 1,12
c 10,14
b 3,100
b 3,100

- Translate to Spanish.

2026-06-02 : Created.

(back to top)

ohazot | about | ohazot.com <admin@ohazot.com>

OpenBSD 7.9 2026-06-02