-k, --key
Sort via a key; KEYDEF gives location and type.
An option of sortx.
Usage
sortx -k KEYDEF [FILE]...
sortx --key=KEYDEF [FILE]...Details
| Short | Long | Value | Default | Meaning |
|---|---|---|---|---|
-k | --key | KEYDEF | sort via a key; KEYDEF gives location and type |
Examples
Sort a colon-separated file numerically on its third field
sortx -t : -k 3,3n /etc/passwdSort on the second column, then by the first in reverse
sortx -k 2,2 -k 1,1r scores.txtHelp in the terminal
gnux help sortx --key