|
1 | | -.\" $NetBSD: sort.1,v 1.43 2026/01/17 19:08:03 jkoshy Exp $ |
| 1 | +.\" $NetBSD: sort.1,v 1.44 2026/01/17 19:29:44 uwe Exp $ |
2 | 2 | .\" |
3 | 3 | .\" Copyright (c) 2000-2003 The NetBSD Foundation, Inc. |
4 | 4 | .\" All rights reserved. |
@@ -452,41 +452,36 @@ and |
452 | 452 | .Sh EXAMPLES |
453 | 453 | To silently check if the lines in a file are sorted lexicographically, |
454 | 454 | use: |
455 | | -.Bd -literal -offset indent |
456 | | -$ sort -C file |
457 | | -.Ed |
| 455 | +.Pp |
| 456 | +.Dl $ sort -C file |
458 | 457 | .Pp |
459 | 458 | To merge three pre-sorted files and write the merged result to stdout, |
460 | 459 | use: |
461 | | -.Bd -literal -offset indent |
462 | | -$ sort -m file1 file2 file3 |
463 | | -.Ed |
| 460 | +.Pp |
| 461 | +.Dl $ sort -m file1 file2 file3 |
464 | 462 | .Pp |
465 | 463 | To sort the lines in a file lexicographically using the second |
466 | 464 | whitespace-separated field of each line as the sort key preserving any |
467 | 465 | leading whitespace in the sort key, use: |
468 | | -.Bd -literal -offset indent |
469 | | -$ sort -k 2 file |
470 | | -.Ed |
| 466 | +.Pp |
| 467 | +.Dl $ sort -k 2 file |
471 | 468 | .Pp |
472 | 469 | To sort the lines in a file lexicographically using the second |
473 | 470 | whitespace-separated field on each line as the sort key ignoring any |
474 | 471 | leading whitespace in the sort key, use: |
475 | | -.Bd -literal -offset indent |
476 | | -$ sort -k 2b file |
477 | | -.Ed |
| 472 | +.Pp |
| 473 | +.Dl $ sort -k 2b file |
478 | 474 | .Pp |
479 | 475 | To sort the lines in a file numerically using the second |
480 | 476 | whitespace-separated field on each line as the sort key, starting the |
481 | 477 | sort key at the second non-blank character within the field, use: |
482 | | -.Bd -literal -offset indent |
483 | | -$ sort -k 2.2nb file |
484 | | -.Ed |
| 478 | +.Pp |
| 479 | +.Dl $ sort -k 2.2nb file |
485 | 480 | .Pp |
486 | 481 | To lexicographically sort the lines of a file in reverse order, use: |
487 | | -.Bd -literal -offset indent |
488 | | -$ sort -r -f file |
489 | | -.Ed |
| 482 | +.Pp |
| 483 | +.Dl $ sort -r -f file |
| 484 | +. |
490 | 485 | .Sh EXIT STATUS |
491 | 486 | Sort exits with one of the following values: |
492 | 487 | .Bl -tag -width flag -compact |
|
0 commit comments